Tuesday, July 22, 2025

WTP in python - Age Group Classifier

Age Group Classifier

Input a person's age and classify them as:


Child (0–12)

Teen (13–19)

Adult (20–59)

Senior (60+)



#take the input from user


age=float(input("Please enter you Age:  "))


if(age>0 and age<=12):

    print(f"{age} , Child")

elif(age>=13 and age<=19):

    print(f"{age} ,Teen ")

elif(age>=20 and age<=59):

    print(f"{age} , Adult")

elif(age>=60):

    print(f"{age} , Senior ")

else:

    print(f"{age} , Invaild Age ")

No comments:

Post a Comment