I need to know how to run code when the for loop reaches a certain number. The loop currently runs
the number of times found in the third value of the list shown below (It is 9 in this example)
['Stack 1', 'Suit A', 9, 6]
My current function is:
def deal_cards(game): for (idx, stack) in enumerate(game): if stack == 'Stack 1': if stack == 'Suit A': for i in range(stack): card_a(stack1_xpos, stack1_ypos)
I want it so that when the loop reaches the same number as the 4th item in the list (6 in this example) it will run the code:
And then return back to running
for the rest of the loop.
How could I do this?