My advanced coding

Now I am switched to the advanced programming where I will be learning OOPs (Object-oriented-Programming) and PP (procedural-programming).

I have already learned define function named as def (variable) :

This can help a coder to optimize the code instead of writing big lines of code.

Here is a sample of code I made of VS code

The code is below

# Giving averages to the students

def grade_students(students_numbers):

    average = {}

    for keys, values in students_numbers.items():

        average[keys] = sum(values)/len(values)

    print(average)

students = {“Ali”:[65,98,70],”Babur”:[33,50,99]}

grade_students(students)

bublooscientist.com
https://www.bublooscientist.com

Leave a Reply