Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. def read_input(message):
  2. # valid only takes input that has been converted to lower case
  3. valid = {"yes": True, "y": True, "no": False, "n": False}
  4.  
  5. response = input(message + "? [Y/n]\n")
  6. return(valid[response.lower()])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement