I think that maybe it should be something I know, but I just can not think about it. I am trying to get a function to create a list where the name of the list is the argument given in the function;
def make_hand (deck, handname): for example: hnnname = [] range for c (5): handname.append (deck.pop ())
The issue is that it creates a list that is called hand name when I want it to be hand-written, before the return handman #deck card has a list containing all the cards in a deck. When creating a user, enter the form of a hand name.
Can anyone help? Thank you
You can place a dictionary where the keys are hand names and are the price list.
Then you can just say the word [handname] to reach a special hand. With the lines:
hands = {} # Hold a new dictionary to hold hands Hand ["flush"] = Mac_Hand (deck) # Generate some hand using your function Hand ["straight"] = make (deck) # generate another hand with a different name Print hand ["flush"] #Awards later in the hand
Comments
Post a Comment