<p>我是python的新手,我试图弄清楚如何向用户请求输入,然后使用该输入从一副卡片中选择一张特定的卡片。这就是我目前所拥有的</p>
<pre><code>cardfaces = []
suits = ["Hearts", "Diamonds", "Clubs", "Spades"]
royals = ["J", "Q", "K", "A"]
deck = []
for i in range(2,11):
cardfaces.<a href="https://www.cnpython.com/list/append" class="inner-link">append</a>(str(i))
for j in range(4):
cardfaces.append(royals[j])
for k in range(4):
for l in range(13):
card = (cardfaces[l] + " of " + suits[k])
deck.append(card)
for m in range(52):
print(deck[m])
pick=input('Pick a card 1-52 :')
</code></pre>