How to write a program that prints a two-column list or more for list phrases


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python

Replace this line with your code.

<do not remove the three backticks above>

#2
>>> four_cols = []
>>> four_cols.append(['oneone','onetwo','onethree','onefour'])
>>> four_cols.append(['twoone','twotwo','twothree','twofour'])
>>> four_cols.append(['threeone','threetwo','threethree','threefour'])
>>> four_cols.append(['fourone','fourtwo','fourthree','fourfour'])
>>> for i in four_cols:
	for j in i:
		print ('{:12}'.format(j), end='')
	print ("\n")

	
oneone      onetwo      onethree    onefour     

twoone      twotwo      twothree    twofour     

threeone    threetwo    threethree  threefour   

fourone     fourtwo     fourthree   fourfour    

>>> 
>>> for i in four_cols:
	for j in i:
		print ('{:12}'.format(j), end='')
	print ('')

	
oneone      onetwo      onethree    onefour     
twoone      twotwo      twothree    twofour     
threeone    threetwo    threethree  threefour   
fourone     fourtwo     fourthree   fourfour    
>>> 

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.