Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # http://python.assignmentsolutionguru.com/
- numlist = []
- while True:
- try:
- temp = input('Enter a number or press "Enter" to finish: ')
- if temp == "": # "Enter" pressed, break the loop
- break
- tempint = int(temp)
- numlist.append(tempint)
- print(numlist)
- except ValueError:
- # Could not convert the input to Integer, bad input
- print('Please enter an integer.')
- print(numlist)
- # http://python.assignmentsolutionguru.com/
Add Comment
Please, Sign In to add comment