@acwoss/

CarelessIncompatibleGrackle

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from collections import namedtuple
from itertools import product
from random import shuffle

Card = namedtuple('Card', ('number', 'suit'))

def create_deck():
    
    NUMBERS = ('2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A')
    SUITS = ('\u2665', '\u2666', '\u2660',  '\u2663')
    
    return [Card(number, suit) for number, suit in product(NUMBERS, SUITS)]
        
deck = create_deck()

shuffle(deck)

print('A primeira carta é:', deck.pop())