0

I have my line of code for a guessing game. But it tells me that: unindent does not match any outer indentation level, could you help me find other mistakes? Thanks!

number = random.randint(1, 99)
guess = int(raw_input("Enter an integer from 1 to 99: "))
guesses = 0
print ('this is your guess', guess)
if guess < number:
    print ('guess is low')
elif guess > number:
    print ('guess is high')
elif guess == number:
    break
J. DOe
  • 1
  • 1
    Is that all your code? If so, what's with the `break`? You aren't inside a loop. – Andrew Li Aug 05 '17 at 15:30
  • 1
    I suggest you use an IDE such as PyCharm to help weed out such issues. Regarding your issue, do you mix spaces and tabs, it might be an issue. – Adonis Aug 05 '17 at 15:31

1 Answers1

0

Unless this code chunk is inside some type of loop then the error is the break on the last line. break can only be used on loops and not of if/else.

Ali Camilletti
  • 116
  • 1
  • 3
  • 11