a simple python code that astonishingly ignores if condition & statement
Question: I have a really simple code here. But the problem is really bothering me. In
line no 7, there is a if-condition; astonishingly this if condition is never
addressed! I ran the program and checked multiple times using python version
2.7. It behaves as if the if-condition and its statements (along with break)
is inside the comment and is simply ignored.

    
    
    from random import randint
    random_number = randint(1, 10)
    guesses_left = 3
    while (guesses_left>=1):
        print (random_number)
        guess = raw_input('Guess ?')      
        if guess == random_number: #this statement is never checked?
            print ('You win!')
            break
        guesses_left -= 1 
    else:
        print ('You lose.')
    


Answer: 
    if guess == random_number: #this statement is never checked?
    

It _is_ being checked, but it’s just _always_ false.

`guess` is a _string_ since it comes from `raw_input` but `random_number` is
an int coming from `randint`. Since a string can never be equal to an int, the
expression is always false.

You need to convert the input into an int first: `int(guess)`. But make sure
you check for errors when the user does not enter a number.

