import random
hs = ['\u2660', '\u2663', '\u2665', '\u2666']
num = ['3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A', '2']
poke = {}
flag = 1
for i in num:
for j in hs:
poke[flag]=j+i
flag += 1
poke[flag]="小王"
poke[flag+1]="大王"
r = random.sample(range(1, 55), 54)
key = [r[0:17], r[17:34], r[34:51], r[51:54]]
players = {
"player_1" : [j for i,j in poke.items() if i in key[0]] ,
"player_2" : [j for i,j in poke.items() if i in key[1]] ,
"player_3" : [j for i,j in poke.items() if i in key[2]]
}
yp = [j for i,j in poke.items() if i in key[3]]
landowner:int = random.sample(range(0,3), 1)
for player in players.keys():
if int(player[7:8])==landowner[0]+1:
landowners = key[landowner[0]]+key[3]
players[player] = [ j for i,j in poke.items() if i in landowners ]
print("这副扑克牌是:{}".format(poke))
print("player_1有{}张牌,分别是:{}".format(len(players["player_1"]), players["player_1"]))
print("player_2有{}张牌,分别是:{}".format(len(players["player_2"]), players["player_2"]))
print("player_3有{}张牌,分别是:{}".format(len(players["player_3"]), players["player_3"]))