Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Simple Number Counter V2
- #My attempt at V1 didn't go so great.
- #It didn't stop counting!
- #Hopefully this one will turn out to be a success...
- options = ["Yes", "No"]
- def count():
- print 'Welcome to my Number Counter!'
- print 'What number would you like me to count to?'
- x = int (raw_input("Enter: "))
- number = 0
- while number <= x:
- print 'Number: ', number
- number = number + 1
- print 'Finished counting.'
- while True:
- option = raw_input("Would you like to count to another number? (Yes/No) :")
- if option == options[0]:
- print x
- break
- elif option == options[1]:
- print '\n\nPress enter to close...'
- break
- else:
- print 'Enter a Number'
- print 'Please note the number cannot contain digits!'
- count()
Add Comment
Please, Sign In to add comment