Another way (requires 3.8 <= Python, otherwise assigning 'hand' should be on separate row):
from random import sample from itertools import product suits = ["Clubs", "Diamonds", "Hearts", "Spades"] ranks = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace"] deck = {' of '.join(card) for card in product(ranks, suits)} hands = list() for i in range(5): deck = deck.difference(hand := sample(deck, 5)) hands.append(hand)
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.