so my goal is to try to simulate an actaul deck and draw five cards and check if there is a three of a kind. I have no problem making the deck and drawing five cards, the problem arises when i check for three of a kind
my code:
from random import shuffle, sample
from itertools import product
#generating deck
suits = ["s","d","h","c"]
values = ["1","2","3","4","5","6","7","8","9","10","11","12","13"]
deck = list(product(values,suits))
sim = 100000
three_of_a_kind = 0
for i in range(sim):
shuffle(deck)
#generating hand
hand = sample(deck,5)
#checking for three of a kind
if any(hand[0][0] == x[0] for x in hand):
three1 += 1
elif any(hand[1][0] == x[0] for x in hand):
three2 += 1
elif any(hand[2][0] == x[0] for x in hand):
three3 += 1
if three1 == 3 or three2 == 3 or three3 == 3:
three_of_a_kind += 1
prob_three = three_of_a_kind/sim
print(prob_three)
edit: my deck only had 12 cards and I changed it to 13 but my question has not changed