The code needs to ask user to enter any numbers by choice and as many numbers as he/she wants and put them into a list. (This is not what I ask reader to focus on, just an introduction about how the code works!)
When user enters the number 0, the program needs to print the sum, average, minimum and maximum of the list, without including the zero itself.
If possible, I do not want to use any Python import libraries.
try:
user_list = []
print("PRESS 0 to see: \n\t 1. Sum \n\t 2. Average \n\t 3. Minimum \n\t 4. Maximum")
while True:
print("Type number by choice and hit Enter: ")
user_list.append(int(input()))
except:
print(user_list)
What I tried was to implement a if statement after the except statement which still gave me the oppurtinity to enter as many numbers as I wanted, but when entered a letter it stopped.