# what I wrote today

import random

def trial():
  L = ['A',2,3,4,5,6,7,8,9,10,'J','Q','K']*4
  first = L.pop(random.randrange(52))
  second = L.pop(random.randrange(51))
  third = L.pop(random.randrange(50))
  return ((first == 'A' and second == 'A') or
          (second == 'A' and third == 'A') or
          (first == 'A' and third == 'A'))

wins = 0
for i in range(100000):
  if trial():
    wins += 1

print(wins/100000)


# equivalent and prettier

import random

deck = ['A',2,3,4,5,6,7,8,9,10,'J','Q','K']*4
wins = 0
for i in range(100000):
  hand = random.sample(deck, 3)
  if ((hand[0] == 'A' and hand[1] == 'A') or
      (hand[0] == 'A' and hand[2] == 'A') or
      (hand[1] == 'A' and hand[2] == 'A')):
    wins += 1

print(wins/100000)


# maybe even prettier? or maybe obscure

import random

deck = ['A',2,3,4,5,6,7,8,9,10,'J','Q','K']*4
wins = 0
for i in range(100000):
  hand = random.sample(deck, 3)
  if len([1 for c in hand if c == 'A']) >= 2:
    wins += 1

print(wins/100000)
