Printing lists in columns (was: TypeError: 'module object is not callable')
cjt22 at bath.ac.uk
cjt22 at bath.ac.uk
Tue Sep 4 07:52:47 EDT 2007
> But watch out if the lists aren't all the same length: zip won't pad out
> any sequences, so it maynotbe exactly what is wanted here:
>
> >>> x = ['1', '2', '3']
> >>> y = ['4', '5']
> >>> for row in zip(x,y):
>
> print ', '.join(row)
>
> 1, 4
> 2, 5
>
Unfortunately the lists will be of different sizes
By the way I apologise for different questions within the same thread.
When I have another question, I will make a new topic
More information about the Python-list
mailing list