daily pastebin goal
3%
SHARE
TWEET

2.11 Practise

AyedAyedo Jan 16th, 2019 (edited) 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. phrase = input("Talk to Me>")
  2. if phrase == "hi" or phrase=="hey":
  3.     print("hello")
  4. elif phrase == "What is your name" or phrase=="what's your name":
  5.     print ("Marvick")
  6. else:
  7.     print("sorry i dont understand "+"'"+phrase+"'")
  8. print("Lets test your knowledge")
  9. Q1 = input("are you ready? ")
  10. if Q1 == "yes" or Q1 == "bring it on":
  11.     print("In Python, a decision can be made by using if else statement")
  12.     Q2=input("True or False? ")
  13.     if Q2 == "true" or Q2 == "True" or Q2 == "TRUE":
  14.         print("your answer is correct")
  15.     elif Q2 == "FALSE" or Q2 == "False" or Q2 == "false":
  16.         print("your answer is incorrect")
  17.     else:
  18.         print("invalid answer")
  19. elif Q1 == "no":
  20.     print("Please comeback when you are ready")
  21. else:
  22.     print("sorry i dont understand "+"'"+Q1+"'")
  23.  
  24.    
  25. print ("See you again")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top