Last active
July 19, 2022 21:46
-
-
Save daniel-schroeder-dev/d5da32a59b20b4217db5941dec521bb8 to your computer and use it in GitHub Desktop.
Brit Guess The Number
This file contains hidden or 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
from random import randint | |
number_streak = 0 | |
while True: | |
user_choice = int(input("Guess a number between 1 and 100: ")) | |
random_number = randint(1,100) | |
if user_choice == random_number: | |
number_streak += 1 | |
print("You guessed the right number!") | |
elif user_choice < random_number: | |
print("A bit low...") | |
elif user_choice > random_number: | |
print("A bit high...") | |
# Store the user's response | |
___ = input("Would you like to play again? (y/n) ") | |
# If the user's response is anything other than "y" | |
if ___: | |
# Exit the loop | |
___ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment