# The symbols of all playing cards

```from itertools import product, dropwhile from random import randint letters = list(range(2,11)) + ['J','Q','K','A'] types = '♣♦♥♠' cards = tuple(product(letters, types)) print(cards) """ ((2, '♣'), (2, '♦'), (2, '♥'), (2, '♠'), (3, '♣'), (3, '♦'), (3, '♥'), (3, '♠'), (4, '♣'), (4, '♦'), (4, '♥'), (4, '♠'), (5, '♣'), (5, '♦'), (5, '♥'), (5, '♠'), (6, '♣'), (6, '♦'), (6, '♥'), (6, '♠'), (7, '♣'), (7, '♦'), (7, '♥'), (7, '♠'), (8, '♣'), (8, '♦'), (8, '♥'), (8, '♠'), (9, '♣'), (9, '♦'), (9, '♥'), (9, '♠'), (10, '♣'), (10, '♦'), (10, '♥'), (10, '♠'), ('J', '♣'), ('J', '♦'), ('J', '♥'), ('J', '♠'), ('Q', '♣'), ('Q', '♦'), ('Q', '♥'), ('Q', '♠'), ('K', '♣'), ('K', '♦'), ('K', '♥'), ('K', '♠'), ('A', '♣'), ('A', '♦'), ('A', '♥'), ('A', '♠')) """ # Select only the cards required for belote # Option 1: List comprehension belote_cards = tuple([(card, typ) for card, typ in cards if card not in range(2,7)]) # Option 2: Dropwhile belote_cards = tuple(dropwhile(lambda x: x[0] < 7, cards)) # Option 3: Filter belote_cards = tuple(filter(lambda x: letters.index(x[0]) > 7 - 3, cards)) # Draw 5 unique cards for each belote player bc = list(belote_cards) print([[bc.pop(randint(0, len(bc) - 1)) for _ in range(5)] for _ in range(4)]) """ [ [('Q', '♠'), ('K', '♠'), ('J', '♥'), (9, '♣'), (8, '♦')], [(9, '♥'), ('Q', '♦'), (9, '♠'), (8, '♣'), ('K', '♥')], [('A', '♦'), ('J', '♠'), ('J', '♣'), ('K', '♣'), (7, '♦')], [(8, '♥'), ('A', '♠'), (9, '♦'), (7, '♠'), ('A', '♥')] ] """ ```