Skip to content

Instantly share code, notes, and snippets.

@accessnash
Created October 19, 2015 07:26
Show Gist options
  • Save accessnash/33af314298ea6859d56a to your computer and use it in GitHub Desktop.
Save accessnash/33af314298ea6859d56a to your computer and use it in GitHub Desktop.
"""Guessing game using random module"""
import random
secret = random.randint(1, 99)
guess = 0
while True:
guess = int(input("Guess a number: "))
if guess > secret:
print ("Too high")
elif guess < secret:
print ("Too low")
else:
print ("You guessed it!")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment