Advertisement
SimeonTs

SUPyF2 Basic Exercise - 02. Drink Something

Sep 24th, 2019
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. """
  2. Basic Syntax, Conditional Statements and Loops - Exercise
  3. Check your code: https://judge.softuni.bg/Contests/Compete/Index/1719#1
  4. Video: https://www.youtube.com/watch?time_continue=4&v=7sHE4HEUqi8
  5.  
  6. SUPyF2 Basic Exercise - 02. Drink Something
  7.  
  8. Problem:
  9. Kids drink toddy, Teens drink coke, Young adults drink beer, Adults drink whisky.
  10. Make a program that receives an age, and returns what they drink.
  11. Rules:
  12. Kids under 14 years old.
  13. Teens under 18 years old.
  14. Young adults under 21 years old.
  15. Adults above 21.
  16. Note: All the values except the last one are inclusive!
  17.  
  18. Examples:
  19. Input:  Output:
  20. 13      drink toddy
  21. 17      drink coke
  22. 21      drink beer
  23. 30      drink whisky
  24. """
  25.  
  26. age = int(input())
  27.  
  28. if age <= 14:
  29.     print("drink toddy")
  30. elif 14 < age <= 18:
  31.     print("drink coke")
  32. elif 18 < age <= 21:
  33.     print("drink beer")
  34. else:
  35.     print("drink whisky")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement