Part of a Whole - General question


Hey so this is the code that i got to work for Part of a whole

def get_class_average(students):
results = []
for student in students:
return average(results)

the part that i dont get is the for condition/statement, especially this part:

for student in students

what is "student" or where is it called from?


Hello, @itwasthisbig!
The parameter students is your list, where you'll iterate through it using the for loop.
The variable you'll use to iterate through is student. Each time the loop is executed, it will get one part of your list, which is this case is lloyd, and use that as a parameter to get the result from the average of his grades.

Just remember: for iterationVariable in whereTheIterationWillHappen

Hope that's clear now!
Best regards,