-
Notifications
You must be signed in to change notification settings - Fork 0
/
afterroundonebot.py
58 lines (49 loc) · 1.76 KB
/
afterroundonebot.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def player():
__name__ = '__main__'
import random
global name
name = input("Enter you name:")
def playern():
try:
global num
num = int(input("Enter your lucky number(from 1-10):"))
except ValueError:
print("You need to enter a valid whole number.", name.capitalize())
playern()
else:
if num > 11:
print("you need to enter a value less than or equal to '10'")
playern()
return
def gnumc():
global cnum
cnum = random.choice(range(1, 11))
if cnum != num:
return cnum
else:
gnumc()
gnumc()
print("Computer's lucky number is:", cnum)
print("welcome ", name.capitalize(), "your lucky number is ", num, " \n START GAME:")
def aro():
try:
x = int(input("After round one,Original panadol extra ,Otun gbede:"))
except ValueError:
print("You need to enter a valid whole number.")
aro()
else:
if x > 5:
print("you need to enter a value less than or equal to '5'")
aro()
cx = random.choice(range(0, 6))
sx = cx+x
print("Computer played: ", cx, "\nSum : ", sx)
if sx == num:
print("you won,hurray!!!")
elif sx == cnum:
print("Computer wins,ha ha ha")
else:
aro()
aro()
playern()
player()