Untitled
unknown
plain_text
a year ago
507 B
11
Indexable
import random
# Step 1: Create a deck of cards
suits = ['ā ', 'ā„', 'ā¦', 'ā£']
ranks = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
deck = [rank + suit for suit in suits for rank in ranks]
# Step 2: Shuffle the deck
random.shuffle(deck)
# Step 3: Deal 5 cards to two players
player1 = [deck.pop() for _ in range(5)]
player2 = [deck.pop() for _ in range(5)]
# Step 4: Show the hands
print("š§ Player 1's Hand:")
print(player1)
print("\nš¤ Player 2's Hand:")
print(player2)Editor is loading...
Leave a Comment