Created
December 8, 2016 18:19
-
-
Save joetechem/f371b587880eb5ac4ecccd7655d74c8f to your computer and use it in GitHub Desktop.
random_number_use_binary_search_method.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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