List 'a' can be printed as follows (CODE1):
a = [[4, 5], [2, 6]]
print(*a, sep='\n')
The output (OP1) is:
[4, 5]
[2, 6]
I want the sublists to be printed in tab separated form. This can be done using loop as follows (CODE2):
for b in a:
print(*b, sep='\t')
Its output (OP2) is:
4 5
2 6
Can I get OP2 by modifying CODE1? I think list comprehension would be one of the routes of achieving this.
Questions referred