Printing lists in column format in Python
Question: I'm setting up a game of solitaire and I'm trying to figure out some ways that
I could print each list of cards in column format. Any ideas on how I could go
about doing this with the following lists?

    
    
    [6♦]
    [2♣, 6♠, A♣, 7♣, J♣, XX]
    [4♥, 2♥, 4♠, 8♣, 5♦, XX, XX]
    [5♠, 3♦, A♠, 10♦, 3♠, XX, XX, XX]
    [7♥, 10♣, 10♥, 2♦, J♠, XX, XX, XX, XX]
    [8♦, 3♣, 7♦, 9♥, K♠, XX, XX, XX, XX, XX]
    [7♠, Q♠, 9♠, A♦, 3♥, XX, XX, XX, XX, XX, XX]
    


Answer: Taking some guesswork on what you have available in your code and what you
want to do, I would say that you should print an element from each list on a
row and then move to the next list.

    
    
    # -*- coding: utf-8 -*-
    from itertools import izip_longest
    
    L1 = [u'6♦']
    L2 = [u'2♣', u'6♠', u'A♣', u'7♣', u'J♣', u'XX']
    L3 = [u'4♥', u'2♥', u'4♠', u'8♣', u'5♦', u'XX', u'XX']
    
    for a,b,c in izip_longest(L1, L2, L3, fillvalue=' '):
        print u'{0}\t{1}\t{2}'.format(a,b,c)
    

With few changes, you should get what you are looking for. However for more
serious terminal game UI, you should consider using [python
curses](https://docs.python.org/2/howto/curses.html).

