Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- score = 0
- def deal_hand():
- for _ in xrange(3):
- random.shuffle(deck)
- hand.append(deck.pop())
- def check_odds():
- for n in hand:
- if n % 2 == 0:
- return False
- return True
- for n in xrange(10000000):
- deck = [_ for _ in range(1, 11)]
- hand = []
- deal_hand()
- if (10 in hand) or check_odds():
- score += 1
- probability = (score/10000000.0) * 100
- print probability, " %"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement