0

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

4
Contributors
3
Replies
6
Views
11 Years
Discussion Span
Last Post by jrcagle
0

You can define matrix using list:

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

0

There are modules like numpy, that do high speed array and matrix manipulations. Google for numpy, its free.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.