Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def main():
- price = 25
- inflation = 3
- ror = 8
- total=0
- FREQ = 12
- AGE = 17
- END_AGE = 65
- x=0
- for i in range(END_AGE - AGE):
- haircutCostPerYear = price*FREQ
- total = total + haircutCostPerYear
- total = total *(1+ror/100)
- price = price * (1+inflation/100)
- print(f'Total saved is {total}')
- d=1
- while(total > 0):
- total = gamble(total)
- print(f'After {d} drunken casino night, Total saved is {total}')
- d += 1
- def gamble(total):
- num = random.randint(1,2)
- if num==1:
- total = total * 2
- else:
- total = 0
- return total
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement