I am doing my homework and it requirers me to use a sum () and len () functions to find the mean of an input number list, when I tried to use sum () to get the sum of the list, I got an error TypeError: unsupported operand type(s) for +: 'int' and 'str'. Following is my code:
numlist = input("Enter a list of number separated by commas: ")
numlist = numlist.split(",")
s = sum(numlist)
l = len(numlist)
m = float(s/l)
print("mean:",m)
Convert the string input to a list of float values. Here is the updated code.