5.4.7 Teenagers Code HS

Can someone help me with this? i currently have

if (age = 13){
println("Yes, you are a teenager.");
}else{
if (age <= 19){
println ("No, you are not a teenager.");
}

and anytime I type anything it always says yes so I'm confused.​

547 Teenagers Code HSCan someone help me with this i currently have if age 13printlnYes you are a teenagerelseif age lt 19println No you are not a teenagerand a class=

Respuesta :

Answer:

var teen = readInt("Are you a teen, if so what is your age? " );

if(teen >= 13 &&(teen < 19)){

    println("Yes, you are a teenager.");

}else{

      println("No, you are not a teenager.");  

}

Explanation:

Hopefully this helps you :)

x = int ( input("what is your age ? "))

if x >= 13 and x <= 19:

       print("yes you are a teenager")

else:

        print("No, you are not a teenager")

The variable x is used to store the user input. it prompts the user to input his/her age.

The if/else statement is used to check if the user is a teenager or not. If the user's age is between 13 and 19, both inclusive the use will get a message "yes you are a teenager " and if otherwise the user will gets a message "No, you are not a teenager"

The bolded word in the codes are key words in python. Pay attention to indentation.

read more: https://brainly.com/question/12089897?referrer=searchResults

ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE