Question: How do I fix this program to run it in python? It keeps giving me the error of expected an indented block . def main():

How do I fix this program to run it in python? It keeps giving me the error of "expected an indented block ".

def main():

#gets grade 1

grade1 = int(input('Enter your first grade: '))

# determines the grade

determine_grade(grade1)

#gets grade 2

grade2 = int(input('Enter your second grade: '))

# determines the grade

determine_grade(grade2)

#gets grade 3

grade3 = int(input('Enter your third grade: '))

# determines the grade

determine_grade(grade3)

#gets grade 4

grade4 = int(input('Enter your fourth grade: '))

# determines the grade

determine_grade(grade4)

#gets grade 5

grade5 = int(input('Enter your fifth grade: '))

# determines the grade

determine_grade(grade5)

#calculates average score

average = calc_average(grade1, grade2, grade3, grade4, grade5)

#displays overall average score and grade

print (" Average score and results")

#displays score

print ("score :" ,average)

#determine grade

determine_grade(average)

#function to calculate average of the given marks

def calc_average(grade1, grade2, grade3, grade4, grade5):

average_score = (grade1 + grade2 + grade3 + grade4 + grade5) / (5.0)

return average_score

#function to determine the grade based on the score

def determine_grade(score):

if(score < 60):

print "your grade is an F"

elif(score >= 60 and score <=69):

print "your grade is a D"

elif(score >=70 and score <=79):

print "your grade is a C"

elif(score >=80 and score <=89):

print "your grade is a B"

elif(score >=90 and score<=100):

print "your grade is an A"

else:

print 'Error: you have not entered a number between 0 and 100.'

return score

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!