Write a program to get numbers as input from the user and save them in a list. The program should keep getting the input until they type, Quit. If they typed Quit, it should stop asking for the input and should print the number they have typed.
#!/usr/bin/env pyhton
numbers = []
while True:
s = input('Enter a number or "Quit" to exit: ')
if s == 'Quit':
break
x = int(s)
numbers.append(x)
print('The number you have enterd:')
for x in numbers:
print(x, end=' ')
Comments
Leave a comment