Skip to content

Instantly share code, notes, and snippets.

/casino.py Secret

Created March 26, 2016 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/182cd8a25820e340fdca to your computer and use it in GitHub Desktop.
Save anonymous/182cd8a25820e340fdca to your computer and use it in GitHub Desktop.
Winnings after ten games
from random import random
winnings = 0
games_to_play = 10
for x in range(games_to_play):
winnings -= 250 # Gotta pay to play.
current_play = 0
cards_drawn = 0
while current_play <= 1:
random_number = round(random(), 1)
current_play += random_number
cards_drawn += 1
else:
winnings += cards_drawn * 100
print("Winnings ${}".format(winnings))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment