# I need you to give me 2 different letters

2

I'm trying to make a `poker` game to play. The problem is that at the time of telling him that he is giving me two cards from the deck, he gives me only one card twice.

For example, you give me `Q` of heart and `Q` of heart or 5 of diamonds and 5 of diamonds. The problem is that it is the same letter. I need two different decks from the deck. I show you what I did next:

``````palos = ["h","d","c","s"]
rangos = ["2","3","4","5","6","7","8","9","10","J","Q","K","A"]

Mazo = []

for palo in palos:

for rango in rangos:

Mazo.append(rango + palo)
Mazo=set(list(Mazo))

import random

while len(Mazo)>1:
Mazo.remove(random.choice(list(Mazo)))
#print(Mazo)

#print(Mazo)
print("\n")

for Carta in Mazo:

print("\n")
``````

asked by Godprogrammer 29.09.2017 в 06:14
source

2

That's because you're deleting all the cards, except one in this part:

``````while len(Mazo)>1:
Mazo.remove(random.choice(list(Mazo)))
``````

And then they're printing that single letter twice. What I would do is take a card, assign it to a player, print it and then delete it. This would make the for. The program would look like this:

``````palos = ["h","d","c","s"]
rangos = ["2","3","4","5","6","7","8","9","10","J","Q","K","A"]

Mazo = []

for palo in palos:

for rango in rangos:

Mazo.append(rango + palo)
Mazo=set(list(Mazo))

import random

while len(Mazo) > 1:
If you want all the cards to be saved, then each player should have a `lista` of cards.