Advertisement
scipiguy

Python 101: Week 2 Ifs challenge

Apr 22nd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. # Futurelearn: Python 101 from RPi Foundation - Ifs
  2.  
  3. phrase = input("Talk to me > ")
  4.  
  5. if phrase == "hi":
  6.     print("hello")
  7. elif phrase == "whats your name":
  8.     print("Marvin")
  9. else:
  10.     print("sorry I don't understand '" + phrase+ "'")
  11. print("bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement