I want the program to randomly issue five cards with different colors and numbers (it doesn"t matter if there are occasional cards with the same number), but I find that five cards are always the same.
import random
suites = ["Hearts", "Diamonds", "Spades", "Clubs"]
cardFaces = ["Ace", 2, 3, 4, 6, 7, 8, 9, 10, Jack, Queen, King]
cardFace = random.choice (cardFaces)
suite = random.choice (suites)
pickACard = [str (cardFace) + "of" + str (suite)]
hand = []
for i in range (5):-sharp do the body five times
card = pickACard
hand.append (card)
print (hand)
run result:
[["Queen of Clubs"], [" Queen of Clubs"]]
Process finished with exit code 0
am I missing something?