jeudi 23 janvier 2020

Random.choice(seq), update a list

I'm making black jack, but im very fresh and green in programming, i made a list with 312 cards and when i make random choice of 2 cards, how to make to update list to 312 cards - 2 chosen cards?

cards=["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A", "2", "3", "4", "5", 
"6", "7", "8", "9", (......etc........>>>>>)", "K"]
print("Available cards",(len(cards)))
play=random.choice(cards)
play1=random.choice(cards)
start=input()
if start=="play":
    print((play),(play1))

Maybe is possible some way raplace like a cards=cards-play-play1?




Aucun commentaire:

Enregistrer un commentaire