Loops 8/19

from random import randint
guesses_left = 3
# Generates a number from 1 through 10 inclusive
random_number = randint(1, 10)

while guesses_left > 0:
  guess = int(raw_input("Your guess: "))
  guesses_left -= 1

  if guess == random_number:
    print "You win!"
  print "You lose."

Why is my code not working and getting stuck all the time?


get stuck how? Fail to input numbers? Maybe show a screenshot where you get stuck?


Your guess: Traceback (most recent call last):
File “python”, line 7, in
ValueError: invalid literal for int() with base 10: ‘RUN’

This is the error message that I am getting


that is a bug, try refreshing the page/different browser.

This bug is keep coming back for some reason, not sure why


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