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?
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?
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.
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)
.