Skip to content

Commit b59b770

Browse files
lesson10LotteryGamePart1
1 parent c85805d commit b59b770

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

10lesson.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# lottery game
2+
import secrets
3+
secureNumber = secrets.SystemRandom()
4+
# build object
5+
# print(secureNumber)
6+
7+
while True:
8+
print('_________Welcome to 2D game with Python Programming_________')
9+
# exit()
10+
press1 = int(input('______Press 1 for RULES OR 2 to start Game!____'))
11+
if press1 == 1:
12+
print(' >Your Age must be greater than or equal 17! ')
13+
print(' >You need aleast 10000 Coin! ')
14+
print(' >Your need to use aleast 1000 Coin to start game! ')
15+
if press1 == 2:
16+
print(' >You can start to play game Now! -----------')
17+
print(' > Now, You need to fill some of your informations...')
18+
print('Lets Start!')
19+
clientName = input('Type your name : at least 3 words')
20+
clientAge = int(input('Type your age : at least 17year!'))
21+
if len(clientName) < 3:
22+
print('Your Name must be aleast 3Characters!')
23+
if clientAge < 17:
24+
print('Your Age must be aleast 17!')
25+
exit()
26+
if len(clientName) > 3 and clientAge >= 17:
27+
print('You can play game Now. ...')
28+
print('Welcome', clientName ,'!. . ')
29+
clientMoney = int(input('Now, Enter your coin! : aleast 10000 Coin'))
30+
while clientMoney < 10000 or None:
31+
print('Coin must be aleast 10000!', clientName, 'coin is', clientMoney )
32+
clientMoney = int(input('Please valid coin!'))
33+
if clientMoney < 10000:
34+
continue
35+
if clientMoney >= 10000:
36+
print('Hello', clientName, 'Thanks You! - - - -')
37+
clientUseMoney = int(input('How many conin wanna use ? Enter. :aleast 1000 : '))
38+
while clientUseMoney < 1000 or None:
39+
print('Use Coin must be aleast 1000!', clientName, 'Used coin is : ', clientUseMoney )
40+
clientUseMoney = int(input('Please valid Use coin!'))
41+
if clientUseMoney < 1000:
42+
continue
43+
if clientUseMoney >= 1000:
44+
print('You used ', clientUseMoney , 'coin for game!- - -')
45+
luckyNum = int(input('Insert your lucky Number! Must be two Number!------ '))
46+
while len(str(luckyNum)) < 2 or None:
47+
print('Use two number!', clientName, 'inserted lucky number is', luckyNum )
48+
luckyNum = int(input('Please valid Luck Number!'))
49+
while len(str(luckyNum)) < 2 or len(str(luckyNum)) > 2:
50+
continue
51+
if len(str(luckyNum)) == 2:
52+
sysNumber = secureNumber.randint(10,99)
53+
countNum = 0
54+
while countNum < 3:
55+
print('Wait... What is Number Today is . . .')
56+
countNum +=1
57+
if sysNumber == luckyNum:
58+
clientMoney = clientMoney + clientUseMoney
59+
print('Today Number is : ', sysNumber)
60+
print('Hey',clientName,'Congratulation. . .You Won!!!!----')
61+
print('Hey',clientName,'You got',clientMoney)
62+
else:
63+
clientMoney = clientMoney - clientUseMoney
64+
print("Today number is :", sysNumber)
65+
print("Your Lucky number is :", luckyNum)
66+
print("Sorry..Good Luck again", clientName)
67+
print('Hey',clientName,'Your Coin : ',clientMoney)
68+
print('Your Coin',clientMoney)
69+
70+
71+
72+
73+
74+
75+

0 commit comments

Comments
 (0)