-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuessingGame
More file actions
44 lines (43 loc) · 1.97 KB
/
GuessingGame
File metadata and controls
44 lines (43 loc) · 1.97 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import random
def Guessing_Game(a,b):
lives=3
secret= random.randint(a,b)
guess=int(input("Hello! This is a guessing game, you have just input two numbers in which a random number is selected between the two numbers you chose! Guess which number it is on the next line >"))
if secret == guess:
print("Level up")
secret2= random.randint(a,b+5)
guess2= int(input("Good job! Now the range is increased by 5! Guess the new number! >"))
elif lives>0:
print("You lost a life, but you can still go on")
lives=lives-1
else:
return("To live is to suffer, to survive is to find some meaning in the suffering")
if secret2 == guess2:
print("Level up")
secret3= random.ranint(a,b+5)
guess3= int(input("Good job! Now the range is increased by 5! Guess the new number! >"))
if secret3 == guess3:
print("Level up")
elif lives>0:
print("You lost this, but you can still go on")
lives=lives-1
else:
return("To live is to suffer, to survive is to find some meaning in the suffering")
secret4= random.ranint(a,b+5)
guess4= int(input("Good job! Now the range is increased by 5! Guess the new number! >"))
if secret4 == guess4:
print("Level up")
secret5= random.ranint(a,b+5)
guess5= int(input("Good job! Now the range is increased by 5! Guess the new number! >"))
elif lives>0:
print("To live is to suffer, to survive is to find some meaning in the suffering")
lives=lives-1
else:
return("Game over")
if secret5 == guess5:
print("Congrats, either your cheating or you got really lucky to beat my game")
elif lives>0:
print("You lost a life, but maybe you can still beat this!")
lives=lives-1
else:
return("To live is to suffer, to survive is to find some meaning in the suffering")