krypto_wizard
February 8th, 2006, 11:36 PM
I programmed pretty much in C all my life. Now I am learning python.
I have a very basic question. In C you define and have array like
int[] a = {1,2,3,4,5}
or int[2][2] a = { {2,3},
{3,2},
}
The above code show matrix like this
2 3
3 2
How do u do it in python. I understand list, but how do u use those lists to make 2D and 3D array in Python.
I think I am not able to think beyond C, which I think needs to be changed.
All your help is appreciated.
Thanks
I have a very basic question. In C you define and have array like
int[] a = {1,2,3,4,5}
or int[2][2] a = { {2,3},
{3,2},
}
The above code show matrix like this
2 3
3 2
How do u do it in python. I understand list, but how do u use those lists to make 2D and 3D array in Python.
I think I am not able to think beyond C, which I think needs to be changed.
All your help is appreciated.
Thanks