Student becomes the teacher-part of a whole


#1

def average(numbers):
    total = sum(numbers)
    total = float(total)/ len(numbers)
    return total
def get_average(student):
    homework = average(student["homework"])
    quizzes = average(student["quizzes"])
    tests = average(student["tests"])
    return 0.1 * homework+ 0.3 * quizzes +  0.6 *tests
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))
def get_class_average(students):

error : File "python", line 43
def get_class_average(students):
^
IndentationError: expected an indented block. How do i solve it.


#2


If you find out the difference between the two images, You probably find your solution.
More read:
I am Indentation ,Read about me!


#3

Thanks by the way, problem solved.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.