| | |
How to implement multi-dimensional arrays in Python??
![]() |
Does anyone have an idea about implementing two dimensional arrays in Python??
I want to write two programs:
(1) a program for matrix multiplication
(2) a program for displaying Pascal's triangle.
Both these programs require two dimensional array..? Or is there any other way to solve this..
Thanks in anticipation..
Regards,
A Kadri
I want to write two programs:
(1) a program for matrix multiplication
(2) a program for displaying Pascal's triangle.
Both these programs require two dimensional array..? Or is there any other way to solve this..
Thanks in anticipation..
Regards,
A Kadri
•
•
Join Date: Aug 2005
Posts: 148
Reputation:
Solved Threads: 6
You can define matrix using list:
As for multiplication program and Pascal's triangle, you'll need to show some effort. Matrix is not needed for displaying Pascal's triangle
Python Syntax (Toggle Plain Text)
matrix = [[1,2,3],[4,5,6],[7,8,9]] print matrix[0][1]
As for multiplication program and Pascal's triangle, you'll need to show some effort. Matrix is not needed for displaying Pascal's triangle
Last edited by Micko; Sep 6th, 2006 at 2:07 am.
![]() |
Similar Threads
- (reformatted) How to return Multi-Dimensional Arrays (C++)
- Multi-dimensional Arrays: (Python)
- Need help passing a multi-dimensional array (C++)
Other Threads in the Python Forum
- Previous Thread: File Saves
- Next Thread: Breaking out of Nested For Loops (Python)
| Thread Tools | Search this Thread |
accessdenied apache application approximation argv array beginner book builtin calculator change converter countpasswordentry curved dan08 dictionary dynamic edit enter examples file float format function gui homework import inches input java keyboard lapse launcher library line lines linux list lists loop microphone mouse movingimageswithpygame mysql mysqlquery newb number numbers numeric output parameters parsing path phonebook plugin port prime programming projects py2exe pygame pyopengl pysimplewizard python random recursion redirect remote reverse scrolledtext session simple smtp software sprite statictext string strings syntax table tennis terminal text textarea thread threading time tlapse trick tuple tutorial twoup ubuntu unicode unit urllib urllib2 variable wordgame wxpython






