I'm making a simple poker game to print the probability of getting: 1 pair, then 2 pair, then 3 of a kind and 4 of a kind.
What I want to do is make it where we have the user who gets a hand of 5 cards.
Then have it where you traverse through the list to check if each card matches with any of the other cards and to check if it's one pair, two pair, three of a kind, then four of a kind.
Then lastly checking the probability of getting those hands.
I'm just trying to get this started, I'm not sure what method to use to check if any two elements are equal then if there are two pairs then 3 and 4 of a kind.
For each, if-statement I know to use a break and return false so it'll end the while loop.
I am using 1-13 instead of using a dictionary to check for suits.
So far I have just printed the random set for the cards.
def poker():
count = 0
cards = []
while(True):
for i in range(0,5):
cards = random.choice([1,2,3,4,5,6,7,8,9,10,11,12,13])
if(cards[0] == cards[1,2,3,4]):
count+=1