import random
suits = ["Hearts", "Spades", "Clubs", "Diamonds"]
deck =
for suit in suits:
for rank in ranks:
deck.append(f'{rank} of {suit}')
print('There are 52 cards in the deck.')
print('Dealing ...')
hand =
while len(hand) < 5:
card = random.choice(deck)
deck.remove(card)
hand.append(card)
print(f'There are {len(deck)} cards in the deck.')
print('Player has the following cards in their hand:')
print(hand)
Output
There are 52 cards in the deck.
Dealing ...
There are 47 cards in the deck.
Player has the following cards in their hand:
['5 of Clubs', '9 of Clubs', '10 of Diamonds', 'Jack of Clubs', '2 of Clubs']