Code not giving proper result

Hi All,

Im pretty new to coding and tryinng to learn from some basic codes.
Below is the code i have written where it suppose to give me output as “WON” if i guess the number 7 whereas it should give “LOST” if i enter any other number.

But while im running the code it always gives me output as “LOST” even if i guess 7.

Can anyone please help me here.

Num = input("Guess ")
if Num == 7:
print(“WON”)
else :
print(“LOST”)

Regards,
Abhi

Remember that the input function returns a string, not anything else. You need to convert that to an integer, using the int function. The string "7" is not equal to the integer 7, so the expression Num == 7 evaluates to False.