Home > OS >  I couldn't find the differences between these two
I couldn't find the differences between these two

Time:09-20

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 :)

CodePudding user response:

temp variable is missing in the first conditional

difference

  • Related