Invalid literal for int() with base 10: 'RUN'


#1

Hi, I have seen some post about this glitch. When I run the code, it often works, but sometimes this error occurs, and I cannot type anything in, forcing me to reload the page.

I also ran into this glitch in the Battleship!

Just posting to confirm is it a fixed glitch for everyone, or is it just me?

Here is my code

from random import randint

# Generates a number from 1 through 10 inclusive
random_number = randint(1, 10)

guesses_left = 3
# Start your game!
guess = int(raw_input('guess now: '))

while guess != random_number:
  guesses_left = guesses_left - 1
  print 'guesses left: ', guesses_left
  if guesses_left == 0:
    print 'You lose'
    break
  guess = int(raw_input('You\'re wrong, again: '))  
else:
	print 'You win'

This is the exact link to the excercise
https://www.codecademy.com/courses/learn-python/lessons/loops/exercises/your-own-while--else?action=lesson_resume

Replace this line with your code. 


#2

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