Skip to content

Commit 92ae6c1

Browse files
authored
Merge pull request #42 from UjwalKandi/master
Added Roulette-Game.py
2 parents 99a14a4 + aa3975f commit 92ae6c1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Roulette-Game.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from random import randint
2+
3+
totalAmount=1000 #total amount invested
4+
5+
while totalAmount > 0:
6+
print("Welcome !!!\nYou have", totalAmount,"€. Good Luck !!\n_________________________________")
7+
selectedNumber=int(input("\nOn 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("\nThe 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("\nYou now have",totalAmount,"€ left\n_________________________________")
25+
26+
if totalAmount==0:
27+
print("Sorry but you don't have enough money to continue !\nThe game is now ending !")

0 commit comments

Comments
 (0)