Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (25 sloc) 674 Bytes
#Guess The Number
from random import randint
number = randint(1, 100)
guess = 0
tries = 0
mode = input('What mode do you want to play? Easy, Medium or Hard?')
if mode == 'easy':
number = randint(1,10)
elif mode == 'medium':
number = randint(1,100)
elif mode == 'hard':
number = randint(1,1000)
print('Invalid Mode, defaulting to easy')
number = randint(1,10)
while guess != number:
guess = (int(input('What is your guess?')))
if guess < number:
print('Your guess is to low.')
tries += 1
elif guess > number:
print('Your guess is to high')
tries += 1
print(f'You won in {tries} tires')
You can’t perform that action at this time.