+ 1
how to print 2d array in python
4 Answers
0
I suppose there is no such concept of multidimensional array in python, but u can use list within list.
0
yep list within list is same as 2D array such as
g=['abc',d ,e,f]
so writing g[0][2]
gives c
0
in order to print all of the 2D list values use pprint function first import it :
from pprint import pprint
0
I use:
def prarr(arr):
for row in arr:
print(row)
if you don't like the brackets and commas, use:
print(*row)