-
Notifications
You must be signed in to change notification settings - Fork 0
/
infosys_time.py
38 lines (35 loc) · 1.14 KB
/
infosys_time.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
from time import sleep
def run():
print('Press enter to continue and ctrl+c to stop the second hand')
atemp=1
points=0
points_table={}
name=input("Enter name of player")
while True:
try:
for dig in range(1,13):
print(dig)
sleep(0.15)
except KeyboardInterrupt:
print(f'stopped at {dig}')
print("points are added")
sleep(1.1)
if dig in [1,5,9,11]:
points+=10
elif dig in [4,7,8,10]:
points+=20
elif dig in [3,2,6,12]:
points+=30
atemp+=1
if atemp ==4:
print(f'{name} has scored {points} points')
points_table[name]=points
ch=input("Is there any other player(y/n)?").lower()
if ch =='y':
name=input("Enter name of player")
atemp=1
points=0
else:
print("Final result:",points_table)
return
run()