Advertisement
AyedAyedo

2.11 Practise

Jan 16th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  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")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement