from random import randint random_guess = random.randint(1, 10) guesses_left = 3 while guesses_left > 0: guess = int(raw_input("Enter your number: ") if guess == random_guess: print "You win" guesses_left -= 1 else: print "You lose"
It prints Enter your number:and when you enter a number this happens:
Enter your number: Enter your number: You lose
I researched a bit, it seems that when I press enter a code enters /n, but I don’t know how to remove it.
It’s not that critical, but I would like to know how to solve this.