-4

I want to print an initialized 2D array. I have tried this, but it is wrong

>>>a=[[1,43,2], [12,3,42]]
>>>Print a

What is my mistake?

vaultah
  • 44,105
  • 12
  • 114
  • 143

2 Answers2

0

Your array is fine. However, the print statement is not. In python, you should do this:

print(a)

Or

print a

for older versions of python.

-1

This is correct: a=[[1,43,2], [12,3,42]] Your print statement isn't. For Python 2.x it should be print a for Python 3.x it should be print(a).

heinst
  • 8,520
  • 7
  • 41
  • 77
  • Still dont get why this was downvoted. Better answer than the random person who deleted their account... – heinst Dec 29 '15 at 20:35