93.7k views
4 votes
Does anybody know 5.4.7: Teenagers CodeHs. Please help I am stuck in this

User Zlata
by
4.9k points

1 Answer

5 votes

Answer:

The program in Python is as follows:

age = int(input("Age: "))

if age>=13 and age <=19:

print("Teenager")

else:

print("Not a teenager")

Explanation:

This gets input for age

age = int(input("Age: "))

This checks if age is between 13 and 19 (inclusive)

if age>=13 and age <=19:

If yes, the age is teenage

print("Teenager")

If otherwise, the age is not teenage

else:

print("Not a teenager")

User Lubi
by
5.2k points