Skip to content

Instantly share code, notes, and snippets.

@Shamrock-Frost
Created July 31, 2018 03:12
Show Gist options
  • Save Shamrock-Frost/d6cf9f48630ef2fd3c24a7adaaa4b558 to your computer and use it in GitHub Desktop.
Save Shamrock-Frost/d6cf9f48630ef2fd3c24a7adaaa4b558 to your computer and use it in GitHub Desktop.
# Bhí Cathal anseo / Rinne Cathal é seo / Is é seo an cód is fearr
import random
def randburn():
return random.choice(["You've been a bad, bad boy ;)",
"You think you're so smart, don't you?"])
def find_num():
return random.randint(1,100)
def play_game():
print("I'm thinking of a number between 1 and 100")
correct = find_num()
guess = 0
while guess != correct:
guess = input("Guess my number: ")
try:
guess = int(guess)
if not(guess <= 100 and guess >= 1):
print(randburn())
elif guess < correct:
print("My number is higher")
elif guess > correct:
print("My number is lower")
except ValueError:
print(randburn())
print("Congrats, bud! You Win!")
@tommy-mor
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment