Challenge: Age Group Categorizer
Tarea
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.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 4
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 5.56
Challenge: Age Group Categorizer
Desliza para mostrar el menú
Tarea
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.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 4
single