Let\'s say I have this list of asterisks, and I say it to print this way:
list = [\'* *\', \'*\', \'* * *\', \'* * * * *\', \'* * * * * *\', \'* * * *\']
for
If you don't want to import itertools, you can do it like this:
ell = ['* *', '*', '* * *', '* * * * *', '* * * * * *', '* * * *']
unpadded_ell = [s.replace(' ', '') for s in ell]
height = len(max(unpadded_ell))
for s in zip(*(s.ljust(height) for s in unpadded_ell)):
print(' '.join(s))
Note a couple of things:
ell, since list is a built-in word in python.