Let\'s say I have this list of asterisks, and I say it to print this way:
list = [\'* *\', \'*\', \'* * *\', \'* * * * *\', \'* * * * * *\', \'* * * *\'] for
>>> from itertools import izip_longest >>> list_ = ['a', 'bc', 'def'] >>> for x in izip_longest(*list_, fillvalue=' '): ... print ' '.join(x) ... a b d c e f