Is there something wrong with this code?


Is there something wrong with this code.

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 random_number
  guess = int(raw_input("Your Guess: "))
  if guess == random_number:
    print "You Win!"
  guesses_left -= 1
    print "You lose."

How should my while/else be indented?

That line will not be expected by the lesson checker.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.