Skip to content

higher_or_lower.py input bug #1

Description

@ldilley

If you input a non-integer (letter or word) during the number guess loop, the higher_or_lower.py program terminates with the sample output below.

Welcome to higher or lower! Please type easy, hard, or quit. easy
Try to guess the number I give you! 66
Your guess is a little too low, I dont think you will be beating me any time soon.
Try to guess the number I give you! quit
Traceback (most recent call last):
  File "higher_or_lower.py", line 62, in <module>
    start_game()
  File "higher_or_lower.py", line 33, in start_game
    difficulty_level_easy()
  File "higher_or_lower.py", line 17, in difficulty_level_easy
    guess = int(raw_input('Try to guess the number I give you! '))
ValueError: invalid literal for int() with base 10: 'quit'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions