This is exercise 38 of part 4 of the Python Programming Course from MOOC.fi (https://programming-23.mooc.fi/part-4/6-strings-and-lists - the last one on this site). I tried solving it, but the error in the title keeps appearing and I don't know how to solve it, and I couldn't find the solution anywhere.
number_of_students = 0
students_that_passed = 0
amount = [0,0,0,0,0,0]
passing_percentage = 0
sum = 0
points_average = 0
contor = 6
star = "*"
while True:
x, y = input("Exam points and exercises completed: ").split()
if x=="" and y=="":
print("Statistics:")
break
else:
x=int(x)
y=int(y)
x=x+y%10
sum +=x
number_of_students+=1
if x>=0 and x <=14:
amount[0]+=1
if x>=15 and x<=17:
amount[1]+=1
students_that_passed+=1
if x>=18 and x<=20:
amount[2]+=1
students_that_passed+=1
if x>=21 and x<=23:
amount[3]+=1
students_that_passed+=1
if x>=24 and x<=27:
amount[4]+=1
students_that_passed+=1
if x>=28 and x<=30:
amount[5]+=1
students_that_passed+=1
points_average = sum/number_of_students
passing_percentage = (students_that_passed/number_of_students)*100
print(f"Points average: {points_average}")
print(f"Pass percentage: {passing_percentage}")
print("Grade distribution:")
while contor>1:
print(f" {contor-1}:{amount[contor-1]*star}")