Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- capital = int(input('What is your starting capital? ')) # starting capital of the player
- amount = input('What amount do you want to bet? ')
- if amount == 'all':
- amount = capital
- else:
- amount = int(amount)
- while capital >= 0 and amount != 'stop':
- if amount <= capital:
- bet = str(input('Bet on red or black: ')) # bet on red or black
- land = str(input('Result: ')) # colour the ball lands on
- if bet == land:
- capital += amount
- else:
- capital -= amount
- else:
- print(f'You cannot bet {amount} if you only have {capital} dollar.')
- amount = input('What amount do you want to bet? ')
- if amount == 'stop':
- print(f'You end up with {capital} dollar.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement