def func_sum(score,total):
total=0
for data in score:
total+=data
return total
score=[73,95,80,57,99]
total=func_sum(score)
print("Total score:",total)
print ("average score:", total/len(score))
The purpose is to find the total and average of the list, so I coded it like this, but it says that there is no total. I want to know which part is wrong and which part needs to be changed.
python
def func_sum(score,total): You have to erase the total from the . You made a function that takes two arguments and put in only one, so it said that there is no total.
© 2024 OneMinuteCode. All rights reserved.