File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ from random import randint
2
+
3
+ totalAmount = 1000 #total amount invested
4
+
5
+ while totalAmount > 0 :
6
+ print ("Welcome !!!\n You have" , totalAmount ,"€. Good Luck !!\n _________________________________" )
7
+ selectedNumber = int (input ("\n On which number do you want to bet ?" ))
8
+
9
+ x = 0
10
+ x = selectNumber
11
+ if x < 0 or x > 49 :
12
+ print ("You have to bet a number between 0 and 49" )
13
+
14
+ bettingAmount = int (input ("How much do you want to bet on this number?" ))
15
+ numberOutput = randint (0 , 49 ) # line to use to generate a random number between 0 and 49
16
+ print ("\n The number output is" ,numberOutput )
17
+
18
+ if numberOutput == selectedNumber :
19
+ print ("You Win!!!\n _________________________________" )
20
+
21
+ else :
22
+ print ("Sorry but you lost, try again !" )
23
+ totalAmount -= bettingAmount
24
+ print ("\n You now have" ,totalAmount ,"€ left\n _________________________________" )
25
+
26
+ if totalAmount == 0 :
27
+ print ("Sorry but you don't have enough money to continue !\n The game is now ending !" )
You can’t perform that action at this time.
0 commit comments