Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu(message, accepted_vals):
- selection = input(message)
- while selection not in accepted_vals:
- print(f"Are you sure you entered {' or '.join(accepted_vals)}? Try again.")
- selection = input(message)
- return selection
- accepted_vals = ["1", "2"]
- selection = menu("Enter '1' for spacebar and '2' for timer: ", accepted_vals)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement