Advertisement
Sabbir-bin

exc

Jun 17th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. alien=['green','yellow','red']
  2. if 'green' in alien:
  3.     print("that the player just earned 5 points.")
  4. if 'red' in alien:
  5.     print("that the player just earned 5 points.")
  6. if 'yellow' in alien:
  7.     print("that the player just earned 5 points.")
  8. if 'blue' in alien:
  9.     print("the version that fails will have no output")
  10. else:
  11.     print("no color")
  12.  
  13.  
  14. #5.4
  15. print("\n\n\n")
  16. alien=['green','yellow','red']
  17. if 'orange' in alien: #not match the color
  18.     print("that the player just earned 5 points.")
  19.  
  20. else:
  21.     print("that the player just earned 10 points.")
  22. if 'red' in alien:
  23.     print("that the player just earned 5 points.")
  24. if 'yellow' in alien:
  25.     print("that the player just earned 5 points.")
  26. if 'blue' in alien:
  27.     print("the version that fails will have no output")
  28. else:
  29.     print("no color")
  30.  
  31.  
  32. #5.6
  33.     #stage of life:
  34.  
  35. age = int (input("Enter your age :"))
  36.  
  37.  
  38. if (age<2):
  39.     print("the person is baby.")
  40. elif(age <= 2 or age<13):
  41.     print("the person is a kid.")
  42. elif(age<=13 or age<20):
  43.     print("the person is teenager.")
  44. elif(age<=20 or age<65):
  45.     print("the person is adult.")
  46. else:
  47.     print("the person is an elder.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement