I want to create a deck of cards that gets the first card after it shuffles
from random import shuffle
def doing_deck():
value = ['a','2','3','4','5','6','7','8','9','t','j','q','k']
suits = ['H','D','S','C',]
cards = []
for i in range(len(value)):
for x in range(4):
carlos = [value[i] , suits[x]]
carlos = "".join(carlos)
cards.append(carlos)
return cards
cards1 = doing_deck() #cards1 agarra cards sin combinar
def get_shuffled_deck():
shuffle(cards1)
return cards1
list1 = get_shuffled_deck()
print list1
def deal_card(list1):
print list1[0]
del list1[0]
deal_card(list1)
print list1
get_shuffled_deck()
Deal_card()
takes an argument (a list) and should do two things: remove the first element and return it. The problem is that it simply eliminates it. How could I do what I want?