How do I print this list vertically?
Posted
by
UnworthyToast
on Stack Overflow
See other posts from Stack Overflow
or by UnworthyToast
Published on 2013-11-12T03:44:23Z
Indexed on
2013/11/12
3:53 UTC
Read the original article
Hit count: 145
Let's say I have this list of asterisks, and I say it to print this way:
list = ['* *', '*', '* * *', '* * * * *', '* * * * * *', '* * * *']
for i in list:
print i
So here, the output is:
* *
*
* * *
* * * * *
* * * * * *
* * * *
But I want the output to be vertical, like this:
* * * * * *
* * * * *
* * * *
* * *
* *
*
Any tips on doing this? I've tried to conceptualize how to use things like list comprehension or for-loops for this, but haven't got it quite right.
© Stack Overflow or respective owner