I am writing a program that takes an input of several numbers and then puts the inputted numbers in a list. The program then finds and outputs the mean average of all of the numbers in the list to the console. Whenever I run this program, I keep getting the error AttributeError: 'NoneType' object has no attribute 'append'.
What is causing this error?
episode_list= []
mather= input("Enter list:")
for number in mather:
episode_list= episode_list.append(number)
for element in episode_list:
total += element
final= total/ len(episode_list)
print(final)
Update your first
forloop with:list.appenddoes the append operation onlistin place and returnsNone.Also, in your second
forloop, you need to do: