I get the feeling this is probably something I should know but I can't think of it right now. I'm trying to get a function to build a list where the name of the list is an argument given in the function;
e.g.
def make_hand(deck, handname):
handname = []
for c in range(5):
handname.append(deck.pop())
return handname
# deck being a list containing all the cards in a deck of cards earlier
The issue is that this creates a list called handname when i want it to be called whatever the user enters as handname when creating the hand.
Anyone can help? thanks