O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

5-6. Stages of Life:

From

Cover of Python Crash Course

Note

stages = ['baby', 'toddler', 'kid', 'teenager', 'adult', 'elder'] age = 20 if age < 2: stage = 0 elif age < 4: stage = 1 elif age < 13: stage = 2 elif age < 20: stage = 3 elif age < 65: stage = 4 elif age >= 65: stage = 5 print("You are on stage: " + stages[stage])