Skip to content

Instantly share code, notes, and snippets.

@bsoyka
Last active November 10, 2019 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsoyka/a253dd91974d2b91010c85064480e4cb to your computer and use it in GitHub Desktop.
Save bsoyka/a253dd91974d2b91010c85064480e4cb to your computer and use it in GitHub Desktop.
import random
correct = random.randint(1, 10)
guess = input("Enter your guess: ")
guess = int(guess)
while guess != correct:
if guess > correct:
print("You've guessed too high. Try guessing lower.")
else:
print("You've guessed too low. Try guessing higher.")
guess = int(input("Enter your guess: "))
print("Congratulations! You've guessed correctly.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment