+1

how to print 2d array in python

6/29/2016 6:36:35 AM

pulkit29

4 Answers

New Answer

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)