Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Print a nested list line by line in python

A = [[1, 2, 3], [2, 3, 4], [4, 5, 6]]
print("OUTPUT1: ")
[print(a) for a in A];
'''
OUTPUT1:
[1, 2, 3]
[2, 3, 4]
[4, 5, 6]
'''
# --------------------------------------------------------------
# if you don't want to see [] in the printout, then do
# [print(*a) for a in A];
A = [[1, 2, 3], [2, 3, 4], [4, 5, 6]]
print("
OUTPUT2: ")
[print(*a) for a in A];
'''
OUTPUT2:
1 2 3
2 3 4
4 5 6
'''
Comment

Print a nested list line by line in python

A = [[1, 2, 3], [2, 3, 4], [4, 5, 6]]
print("OUTPUT1: ")
[print(a) for a in A];
'''
OUTPUT1:
[1, 2, 3]
[2, 3, 4]
[4, 5, 6]
'''
# --------------------------------------------------------------
# if you don't want to see [] in the printout, then do
# [print(*a) for a in A];
A = [[1, 2, 3], [2, 3, 4], [4, 5, 6]]
print("
OUTPUT2: ")
[print(*a) for a in A];
'''
OUTPUT2:
1 2 3
2 3 4
4 5 6
'''
Comment

PREVIOUS NEXT
Code Example
Python :: how to add card in py-trello 
Python :: how does sns boxplot determine outliers 
Python :: exact distance math 
Python :: python strftime iso 8601 
Python :: pygame change icon 
Python :: pandas query like 
Python :: how to get current page url in django template 
Python :: print a to z in python 
Python :: how to visualize decision tree in python 
Python :: python requests set header cookie 
Python :: django round 2 decimal 
Python :: python endswith list 
Python :: django genericforeignkey null 
Python :: unzip python 
Python :: how to create a custom callback function in keras while training the model 
Python :: is alphabet python 
Python :: python histogram as a dictionary 
Python :: fake migration 
Python :: dict to array of string python 
Python :: python get size of file 
Python :: transparancy argument pyplot 
Python :: python how to get every name in folder 
Python :: python for with iterator index 
Python :: how to add contents of one dict to another in python 
Python :: how to make a never ending loop in python 
Python :: python get square root 
Python :: exoort csv google colab 
Python :: pyqt latex 
Python :: python game over screen 
Python :: delete turtle 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =