Skip to the content.

3.5 Homework

// Popcorn hack 1
let temperature = 53;

let cold = temperature < 60;
if (cold) {
    console.log("Bring a jacket");
} else {
    console.log("You don't need a jacket");
}

// Popcorn hack 2
temperature = 43;

let comfortable = temperature >= 63 && temperature <= 83;

if (comfortable) { 
    console.log("It is a comfortable temperature");
} else {
    console.log("It is not a comfortable temperature");
}

// Popcorn hack 3
let authorized = true;

let canEnter = !authorized;

console.log(canEnter ? "You may enter" : "You may not enter");

# Popcorn hack 1
temperature = 53

cold = temperature < 60
if cold:
    print("Bring a jacket")

else:
    print("You don't need a jacket")
    
# Popcorn hack 2

temperature = 43 

comfortable = temperature >= 63 and temperature <= 83

if comfortable: 
    print("It is a comfortable temperature")
else:
    print("It is not a comfortable temperature")

# Popcorn hack 3

authorized = True

can_enter = not authorized

print("You may enter"
if can_enter 
else "You may not enter")