我正在尝试使用以下代码列出一副卡片中的每张卡片(以及分配给卡片的编号):
suitName = ("hearts", "diamonds", "spades", "clubs")
rankName = ("Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King")
def translate():
rank = ""
suit = ""
cards = ""
cardNum = 0
for x in rankName:
rank = x
for y in suitName:
suit = y
for i in range(0, NUMCARDS):
cards += rank
cards += " of "
cards += suit
cardNum = i
i += 1
print cardNum
print " "
print cards
不过,我的输出只获得了 52 次“俱乐部之王”。我需要做什么?