Problem error taking additional values from the Python list and averaging them
Asked 1 weeks ago, Updated 1 weeks ago, 1 views
num= [30, 29, 47, 10, 78]
a = input ("What number do you want to add?") #Accept a number to add
num.append(a) # Add accepted numbers using append among methods
plus = sum(num)
average = plus / len(num)
If I input it, the number I received is added to the list, but after that, the error appears like this. Where and how should I fix it?
TypeError Traceback (most recent call last)
<ipython-input-17-b5963e133a37> in <module>()
2 a = input ("Number to add?") #Accept a number to add
3 num.append(a) # Add accepted numbers using append among methods
----> 4 plus = sum(num)
5 average = plus / len(num)
TypeError: unsupported operand type(s) for +: 'int' and 'str'