The code below is working completely fine, however I want to add the mean average of the inputted numbers (stored in a .txt file). Im thinking i will have to put the inputted values on different lines but im not sure how to do that either. Is there a simple way to do this?
myFile = open("C38test.txt","wt")
myFile.write(input("Enter numbers to put in a list, leave a space between each number. \n"))
myFile.close()
myFile = open("C38test.txt","rt")
contents = myFile.read()
user_list = contents.split()
for i in range(len(user_list)):
user_list[i] = int(user_list[i])
print("Sum = ",sum(user_list))