numbers = input("give me al list of numbers: ")
list_number = []
for i in numbers:
if i.strip(" "):
list_number.append(i)
print(list_number)
Up to here everything works, but I try to calculate the average and I get this error:
# Traceback (most recent call last):
# TypeError: 'list' object is not callable
I have tried a for loop:
for i in list_number():
average = int(list_number[i])
I tried a simple math calculation storing it in a var but nothing.
average = sum(list_number) / len(list_number)
# error: TypeError: unsupported operand type(s) for +: 'int' and 'str'