Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Age limit

  • Create a script called basic2_age_limit_input.py

  • Ask the user what is their age.

  • If it is above 18, tell them they can legally drink alcohol.

  • If is is above 21, tell them they can also legally drink in the USA.

  • Extra:

  • Create a separate file basic2_age_limit_all_input.py

  • Ask the user for an age and a country name tell them if they can legally drink alcohol.

  • See the Legal drinking age list.

  • Don't worry if this seems to be too difficult now to solve it in a nice way.