模拟斗地主发牌,牌共54张,
花色:黑桃('\u2660'),梅花('\u2663'),方块('\u2665'),红桃(‘\u2666’),种类为:A2-10JQK,大小王(X, x)
三个人,每个人17张牌,牌底留三张输入回车,打印第三个问的17张牌
import random as R
import random as R
"""上面代码的简单实现"""
L = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
L1 = ['X', 'x']
L1.extend(map(lambda x: x+"\u2660", L))
L1.extend(map(lambda x: x+"\u2663", L))
L1.extend(map(lambda x: x+"\u2665", L))
L1.extend(map(lambda x: x+"\u2666", L))
R.shuffle(L1)
print(L1[0:17])
input()
print(L1[17:34])
input()
print(L1[34:51])
input()
print(L1[51:])
import random as R
"""一次一人发一张牌"""
L = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
H = ['\u2660', '\u2663', '\u2665', '\u2666']
w1 = []
w2 = []
w3 = []
P = ['X','x']
for x in H:
for y in L:
s = x + y
P.append(s)
R.shuffle(P)
i = 1
while i <= 17:
w1.append(P.pop())
w2.append(P.pop())
w3.append(P.pop())
i += 1
print(w1)
input()
print(w2)
input()
print(w3)
input()
print(P)