Challenge: Age Group Categorizer
Task
Swipe to start coding
Write a function that determines the age group for a given age using nested if statements.
- Return "Child" if the age is less than 13.
- Return "Teenager" if the age is 13 or greater but less than 20.
- Return "Adult" if the age is 20 or greater but less than 65.
- Return "Senior" if the age is 65 or older.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 5.56
Challenge: Age Group Categorizer
Swipe to show menu
Task
Swipe to start coding
Write a function that determines the age group for a given age using nested if statements.
- Return "Child" if the age is less than 13.
- Return "Teenager" if the age is 13 or greater but less than 20.
- Return "Adult" if the age is 20 or greater but less than 65.
- Return "Senior" if the age is 65 or older.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 4
single