I'm having a hell of a time printing out n elements at a time from a list of tuples of unknown length.
A deck of cards, for example:
a = [ ('2','c'), ('2','d'), ('2','h'), ('2','s'), ('3','c'), ('3','d'), ... ,('A',h'),('A','s') ]
The list in this example starts out at 52 length, but I am popping off elements. I want to print them out in groups of four (for this example), but I keep getting fouled up at the last group which can have fewer than four elements.
Expected output after popping off a bunch of cards is:
('2','c'), ('2','d'), ('2','h'), ('2','s')
('3','c'), ('3','d'), ('3','h'), ('3','s')
...
('J','c'), ('J','d'), ('J','h'), ('J','s')
('Q','c'), ('Q','d')