Skip to content

Instantly share code, notes, and snippets.

@Coolfield
Last active May 2, 2019 12:10
Show Gist options
  • Save Coolfield/99bda5b078bacd41cb8b5325bd32537a to your computer and use it in GitHub Desktop.
Save Coolfield/99bda5b078bacd41cb8b5325bd32537a to your computer and use it in GitHub Desktop.
import random
the_number = random.randint(0, 10)
guess = -1
while guess != the_number:
guess_text = input('Guess a number between 0 and 10: ')
guess = int(guess_text)
if guess is the_number:
print('You won, it was {}!'.format(guess))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment