Skip to content

Instantly share code, notes, and snippets.

@TammyLaforest
Created February 16, 2019 03:18
Show Gist options
  • Save TammyLaforest/e2411ab8411929fc437bbcf2172867c6 to your computer and use it in GitHub Desktop.
Save TammyLaforest/e2411ab8411929fc437bbcf2172867c6 to your computer and use it in GitHub Desktop.
MotionlessGlossyComma created by TammyLaforest - https://repl.it/@TammyLaforest/MotionlessGlossyComma
import random
first = 1
last = 10
number = random.randint(first, last)
guess = int(input("Enter a number from " + str(first) + " to " + str(last) +": "))
while number != guess:
if guess < number:
print("guess is low")
first=guess
guess = int(input("Enter a number from " + str(first) + " to " + str(last) +": "))
elif guess > number:
print("guess is high")
last=guess
guess = int(input("Enter a number from " + str(first) + " to " + str(last) +": "))
print("You guessed it!")
print("Click RUN to play again.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment