print("Enter the Scores:")
total = []
while True:
num = int(input())
if num == -1:
break
total.append(num)
print("The average is:",(sum(total)/len(total)))
I wrote my code in python 3.8. Also, you have to be careful about adding -1 to the total. You don't want to count -1 in the average.