定义好牌的花色和数字
L = ['A','2','3','4','5','6','7','8','9','10','J','Q','K']
H = ['♥','♠','♦','♣']
p = ['大王','小王']
定义玩家
player1 = []
player2 = []
player3 = []
通过嵌套循环来实现花色配对数字
for x in H:
for y in L:
s = x + y
p.append(s)
用列表来随机排列发牌
random.shuffle(p)
i = 1
while i <= 17:
player1.append(p.pop())
player2.append(p.pop())
player3.append(p.pop())
i += 1