I want to make the game more practical that
to limit the raw input into only integer within range (1, 11).
If the input is not integer or integer not in range (1,11), to print "Wrong input" and to ask for another correct input again without decrementing guess number
from random import randint # Generates a number from 1 through 10 inclusive random_number = randint(1, 10) guesses_left = 3 # Start your game! while guesses_left > 0 : print guesses_left guess = int(raw_input("Your guess: ")) if guess guess == random_number : print "You win!" break else: print "Wrong input" guesses_left -= 1 else: print "You lose."