Created
November 5, 2016 12:24
-
-
Save amlwwalker/45f3309922f9ae06ee33fcf75f911a59 to your computer and use it in GitHub Desktop.
Given a 10 percent chance of a 100 times payoff you should take that bet every time. But you're still going to be wrong nine times out of 10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
print "Given a 10 percent chance of a 100 times payoff you should take that bet every time. But you're still going to be wrong nine times out of 10" | |
humanGuess = 4 | |
humanMoney = 10 | |
#first we need a random number, of 1 to 10 | |
for i in range (1,100): | |
randomNumber = randint(1,10) | |
print "Riches: ", humanMoney | |
if (randomNumber == humanGuess): | |
humanMoney += 100 | |
print "Riches: ", humanMoney | |
break | |
else: | |
humanMoney -= 1 | |
if (humanMoney == 0): | |
print "the human is broke: ", humanMoney | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment