Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

print nested list in new lines 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 trello API using python 
Python :: producer consumer problem using queue python 
Python :: how to find exact distance 
Python :: find common words in two lists python 
Python :: when pyspark 
Python :: python conditional assignment 
Python :: how to see if a proxy is up in python 
Python :: how to add headers in csv file using python 
Python :: all permutations python 
Python :: Appending pandas dataframes generated in a for loop 
Python :: list of files in python 
Python :: dict godot 
Python :: invoice parsing ocr python 
Python :: remove substring python 
Python :: python write requests response to text file 
Python :: switch columns and rows python 
Python :: fetch python 
Python :: jupyter notebook check memory usage 
Python :: pandas read excel nan 
Python :: python version command notebook 
Python :: connect to mysql database jupyter 
Python :: python display map 
Python :: actual keystroke python 
Python :: random forrest plotting feature importance function 
Python :: how to use colorama 
Python :: delete index in df 
Python :: select text in a div selenium python 
Python :: pyqt expressions 
Python :: embed_author discord.py 
Python :: how to delete a turtle in python 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =