Python print flexible amount of lists side by side vertically
Question: I'm new to python and trying to print a few lists side by side vertically e.g.
`list_1 = [1,2,3]` and `list_2 = [4,5]`:

output:

    
    
    1 4  
    2 5  
    3 None  
    

i found `map(None, list_1, list_2)` can achieve this.

However, I may have up to >10 lists to print vertically. I wonder if there
some neat way to do this.

Thanks in advance!


Answer: You could use `map(None, list_1, list_2, list_3, ...)`, since `map` can take
an arbitrary number of arguments.

However, it is usually not a good idea to have numbered variable names. It is
often a sign that you should be using a `list` or `tuple` instead. So instead
of having variables `list_1`, ..., `list_10`, you should have one variable
`columns` which is a list of lists.

If `columns = [list_1, list_2]`, then

    
    
    import itertools as IT
    rows = IT.izip_longest(*columns)
    

is equivalent to `map(None, list_1, list_2)` and is compatible with Python3,
which removes the `map(None, ...)` option. Notice that this notation
generalizes well to arbitrary number of lists without requiring you to type
all those variable names by hand.

The `*` in `IT.izip_longest(*columns, ...)` is [Python's unpacking
operator](http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-
in-python/). It unpacks the items in `columns` and sends those items to
`IT.izip` as individual arguments. This notation allows you to send an
arbitrary number of arguments to a function.

