Question

python Suppose that a variable named temp exists and contains a valid integer temperature in degrees...

python

Suppose that a variable named temp exists and contains a valid integer temperature in degrees Fahrenheit. Write one if-elif-else statement that would output cold if the value in temp is below 40; mild if the temp is in the range 40 through 79; and Hot if temp is 80 or above. You may hard-code in numeric literals such as 40, 79, and 80 without creating named constants.

Homework Answers

Answer #1

/*If you any query do comment in the comment section else like the solution*/

temp = int(input("Enter temperature in Fahrenheit: "))
if temp < 40:
    print("cold")
elif temp >= 40 and temp <= 79:
    print("mild")
else:
    print("Hot")

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions