I couldn't find the differences between these two

Viewed 19

Giving error:

temp = int(input("What is the temperature outside?"))
if temp >= 0 and <= 30:
    print("the temperature is good today!")

The original code which is not giving error:

temp = int(input("What is the temperature outside?: "))

if temp >= 0 and temp <= 30:
    print("the temperature is good today!")

Can someone explain me the differences cuz i couldnt find any. i will appreciate it :)

1 Answers

temp variable is missing in the first conditional

difference

Related