Professional Documents
Culture Documents
import random
import matplotlib.pyplot as plt
"""RULES :
1) There are chits containing numbers ranging from 1-100 in a bag.
2) Users can bet on even or odd.
3) In this game 10 and 11 are special numbers. 10 will be counted as an odd number
and 11 will be counted as an even number.
4) If you bet on even number and if you get 10 then you lose.
5) If you bet on odd number and if you get 11 then you lose.
"""
#For even :
if choice=="Even":
def pickNote():
#Get random number between 1-100.
note = random.randint(1,100)
#For odd :
elif choice=="Odd":
def pickNote():
#Get random number between 1-100.
note = random.randint(1,100)
#Main function :
def play(total_money, bet_money, total_plays):
num_of_plays = []
money = []
#Lose :
else:
#Add the money to our funds
total_money = total_money - bet_money
#Append the play number
num_of_plays.append(play)
#Append the new fund amount
money.append(total_money)
#Run 10 iterations :
for i in range(10):
ending_fund = play(10000,100,50)
print(ending_fund)
print(sum(ending_fund))
#Run 10 iterations :
for i in range(10):
ending_fund = play(10000,100,5)
#Run 10 iterations :
for i in range(10):
ending_fund = play(10000,100,10)
#Run 10 iterations :
for i in range(10):
ending_fund = play(10000,100,100)
#Run 10 iterations :
for i in range(10):
ending_fund = play(10000,100,1000)
#Run 10 iterations :
for i in range(10):
ending_fund = play(10000,100,5000)