How do I print this list vertically?

后端 未结 5 1486
猫巷女王i
猫巷女王i 2020-12-11 19:21

Let\'s say I have this list of asterisks, and I say it to print this way:

list = [\'* *\', \'*\', \'* * *\', \'* * * * *\', \'* * * * * *\', \'* * * *\']
for         


        
5条回答
  •  伪装坚强ぢ
    2020-12-11 20:00

    >>> 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
    

提交回复
热议问题