Skip to content

Instantly share code, notes, and snippets.

@joetechem
Created December 8, 2016 18:19
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 joetechem/f371b587880eb5ac4ecccd7655d74c8f to your computer and use it in GitHub Desktop.
Save joetechem/f371b587880eb5ac4ecccd7655d74c8f to your computer and use it in GitHub Desktop.
random_number_use_binary_search_method.py
import random
number = random.randint(1, 100)
print number
GameRunning = True
while True:
guess = int(raw_input("Guess a number between 1-100: "))
if guess == number:
GameRunning = True
print("You guessed correctly!")
elif guess > number:
print("Your guess was too high")
elif guess < number:
print("Your guess was too low")
else:
print("Your did not eneter a number")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment