Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu():
- while True:
- try:
- selection = int(input("Enter 1 for spacebar and 2 for timer: "))
- if selection not in [1, 2]:
- raise ValueError
- return selection
- except ValueError:
- print("Are you sure you entered 1 or 2? Try again.")
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement