Hi I am creating a function to compute the mean from a list of integers inputed by the user. I am getting an error:
ValueError: invalid literal for int() with base 10:
Here is my code:
def calcmean (mylist):
listsum= 0
for index in mylist:
listsum = listsum + index
mean= listsum / len(mylist)
return mean
userinput= [int(input("Enter list separated by commas:"))]
print (mean (userinput))