-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguessing_game.py
27 lines (24 loc) · 1.04 KB
/
guessing_game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from random import randint
answer = randint(0, 10)
print("Please guess the number between 1 and 10: \n")
guess = int(input())
if guess == answer:
print("Dang it! You're right!")
elif guess > answer:
print("Your guess was too high, you have last chance!")
guess = int(input())
if guess == answer:
print("You got it in second try!")
elif guess > answer:
print("Your guess was too high, correct answer is {0}. And remember, House always wins!".format(answer))
else:
print("Your guess was too low, correct answer is {0}. And remember, House always wins!".format(answer))
else:
print("Your guess was too low, you have last chance!")
guess = int(input())
if guess == answer:
print("You got it in second try!")
elif guess > answer:
print("Your guess was too high, correct answer is {0}. And remember, House always wins!".format(answer))
else:
print("Your guess was too low, correct answer is {0}. And remember, House always wins!".format(answer))