0
Need help (list programm)
Sooooo, i need to programm a programm as a homework which lets the user type unlimited inputs of numbers. If the user inputs the number 0, then the programm prints out the max and min input numbers of the list. I tried it and i just need to change how to input unlimited numbers and print the min and max as soon the input is 0. Code: print("Give some numbers") x_list = [] for i in range(10): x_list.append(int(input())) if (len(x_list) == 10): print ("Minimal number is = ", min(x_list)) print ("Maximal number is = ", max(x_list))
1 ответ
0
lst = []
while True:
inp = int(input())
if inp == 0:
print(min(lst), max(lst))
break
lst.append(inp)