Python Midterm 8
Python Midterm 8
count = 1
count2 = 1
count3= 0
num_of_test = int(input('How many tests a student had taken? '))
print('n for no, y for yes')
while count != 0:
enter_grade = input('do you want to enter the grade for students? ')
if enter_grade != 'y':
if count3 != 0:
quit()
continue
elif enter_grade == 'y':
test_total = 0
while count2 < num_of_test + 1:
print ('enter the grade for exam', count2, 'for student no. %d:' %count)
test_score = int(input())
test_total += test_score
count2 += 1
average_score = test_total // num_of_test
count2 = 1
count3 += 1
print (' the average of student', count, 'is %.2f' %average_score)
count += 1