list = [["acd",2,"b"],["c",33,"d"],["e","f",4]]
This is my list.
i want to print like
acd 2 b
c 33 d
e f 4
list = [["acd",2,"b"],["c",33,"d"],["e","f",4]]
This is my list.
i want to print like
acd 2 b
c 33 d
e f 4
You can use a comma to keep printed output on the same line. For example
# don't name a list 'list' in python
lst = [["acd",2,"b"],["c",33,"d"],["e","f",4]]
for sub in lst:
for item in sub:
# for each item in the sublist, print it on a single line
print item,
# at the end of each sublist, print a new line
print ''
To get the output exactly like your example in the question, you'll have to use conditionals to check the size of each item and adjust the amount of spaces it should have before it. But this should be enough to get you started.