Created
January 27, 2017 18:55
-
-
Save joetechem/78ed5dbb6baaa57b3a18a7e9e242b674 to your computer and use it in GitHub Desktop.
random_number_guess
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) # Here's the range of numbers the computer randomly chooses from | |
print number # this line is just so you can test/see the numbers the computer chooses from | |
# You likely want to comment this out once your whole program is running! | |
# GameRunning variable here | |
# Start your while loop here, Watch your indents below this loop! | |
guess = int(raw_input("Guess a number between 1-100: ")) # letting Python know this is an integer | |
if guess == number: # starting your condition statements | |
# GameRunning variable here | |
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 enter a number") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment