Relative Content

Tag Archive for pythonlistfunction

Function calling itself when inserted in a list (or variable)

I am trying to make a silly text based game, and I defined some functions – decision based actions. The problem is, when I make a list with all them functions, for some reason it counts as calling them. Does anone have a solution for this?

How do I move to the next string of a list in a def function?

I am making a Blackjack game and need to generate a random deck. I am doing this by combining each card number with each suit until I have all 52 cards. In my def function to combine each card number and suit, after I make a card I am trying to move to the next string in my cardpips and cardsuits lists. I’ve tried using next() functions to do this but I can’t figure out how to use those properly.