How is Everybody Doing?


#1

Hi Peeps,

I have past the assignment, but still have some questions about the result:

From this:

def get_letter_grade(score):
if score >= 90:
return "A"
elif score >=80:
return "B"
elif score >=70:
return "C"
elif score >=60:
return "D"
else:
return "F"

print get_letter_grade(get_average(lloyd))

students = [lloyd,alice,tyler]
def get_class_average(students):
results = []
for student in students:
results.append(get_average(student))
return average(results)

print get_class_average(students)
print get_letter_grade(get_class_average)

The print is:
B
83.8666666667
A

Why is when the class average is 83.866, they get a grade A.
Should this not be B?


#2

Nevermind,

print get_class_average(students)
print get_letter_grade(get_class_average)

should be:

print get_class_average(students)
print get_letter_grade(get_class_average(students))


#3

Hello Because your code says so. How about you say:

   def get_letter_grade(score):
    if score >= 90:
        return "A"
    elif score >= 80:
        return "B"
    elif score >= 70:
        return "C"
    elif score >= 60:
        return "D"
    else:
        return "F"
get_letter_grade(lloyd)

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