私はPythonでポーカーゲームを作ろうとしています。使用済みのカードをリストから別のリストに移動して、使用済みのカードを保存したいカード。私はこのコードを使用しています:カードゲームのリストを別のリストに移動するPython
deck = ['AS', 'KS', 'QS', 'JS', '10S', '9S', '8S', '7S', '6S', '5S', '4S', '3S', '2S',\
'AD', 'KD', 'QD', 'JD', '10D', '9D', '8D', '7D', '6D', '5D', '4D', '3D', '2D',\
'AC', 'KC', 'QC', 'JC', '10C', '9C', '8C', '7C', '6C', '5C', '4C', '3C', '2C',\
'AH', 'KH', 'QH', 'JH', '10H', '9H', '8H', '7H', '6H', '5H', '4H', '3H', '2H']
used = []
p1 = []
p2 = []
a = 0
while (a < 2):
drawn_card = random.choice(deck)
deck.append(drawn_card)
deck = [f for f in deck if f not in used]
p1.append(drawn_card)
a+=1
# Don't read anything below this line
card1 = p1[0]
card2 = p1[1]
f_card1 = "Name/Suit"
f_card2 = "Name/Suit"
# Formatting Player1's first drawn card
if card1[0] == "A":
f_card1 = "Ace"
elif card1[0] == "K":
f_card1 = "King"
elif card1[0] == "Q":
f_card1 = "Queen"
elif card1[0] == "J":
f_card1 = "Jack"
else:
f_card1 = card1[0]
if card1[1] == "S":
f_card1 = f_card1 + " of Spades"
elif card1[1] == "D":
f_card1 = f_card1 + " of Diamonds"
elif card1[1] == "C":
f_card1 = f_card1 + " of Clubs"
else:
f_card1 = f_card1 + " of Hearts"
# Formatting Player1's second drawn card
if card2[0] == "A":
f_card2 = "Ace"
elif card2[0] == "K":
f_card2 = "King"
elif card2[0] == "Q":
f_card2 = "Queen"
elif card2[0] == "J":
f_card2 = "Jack"
else:
f_card2 = card2[0]
if card2[1] == "S":
f_card2 = f_card2 + " of Spades"
elif card2[1] == "D":
f_card2 = f_card2 + " of Diamonds"
elif card2[1] == "C":
f_card2 = f_card2 + " of Clubs"
else:
f_card2 = f_card2 + " of Hearts"
print(f_card1)
print(f_card2)
while関数は私の問題がどこにありますか?私は時々、それらを印刷するときに同じカードを得ることができます。それをどうやって解決でき、私のミスはどこですか?事前のおかげで