I am having trouble getting the sum of the list inputted by the user, I have tried multiple ways, I just need help in what I can do to the sum of the list. Thanks, for any help.
import statistics
data=[]
while True:
num = input("Enter a number (type quit to leave): ")
data.append(num)
if num == "quit":
data.remove("quit")
break
def Average(data):
return sum(data) / len(data)
print(*data, sep=", ")
data.sort()
print("The max value entered is: ", max(data))
print("The min value entered is: ", min(data))
print("Sorted list: ", data)
print("First and Last removed: ", (data[1:-1]))
print("The List average is: ", sum(data))