Skip to content

Instantly share code, notes, and snippets.

@KatiGithub
Created October 5, 2018 08:38
Show Gist options
  • Save KatiGithub/3c2d5e12dccbe4f843a01c60b3862d1c to your computer and use it in GitHub Desktop.
Save KatiGithub/3c2d5e12dccbe4f843a01c60b3862d1c to your computer and use it in GitHub Desktop.
Guess numbers 1 to 9 until you get it correct!
import sys
import random
randint = random.randint(1, 9)
x = int(input("What is your first guess between 1 to 9: "))
if x == randint:
print("Correct!")
while x != randint:
x = int(input("Wrong!: "))
if x == randint:
print("Correct!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment