Advertisement
HollyPepperony

if elif else challenge

Aug 18th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. phrase = input("Do you want to play a game? ")
  2.  
  3. while phrase != "quit":
  4.     if "no" in phrase or "n't" in phrase:
  5.         print("go to bed then")
  6.         break
  7.     elif "ye" in phrase or "love" in phrase or "like" in phrase:
  8.         print ("Yahoo, let's do it!!!")
  9.         break
  10.     else:
  11.         print ("Sorry I don't understand '" + phrase + "'")
  12.         phrase = input("\rSo, do you want to play a game? ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement