How to input values of the matrix from keyboard in python

MRAB python at mrabarnett.plus.com
Wed Aug 11 15:08:50 EDT 2010


Pramod wrote:
> Hi
> 
>    I want to know the how we input values into the matrix (N*N size)
> from keyboard in python,
> 
> Here I wrote Matrix programe in C++
> 
> 
> This  asks values from key board and print on the console N*N matrix ;
> 
[snip]

Read from the keyboard using raw_input() (in Python 2, or input() in
Python 3) and convert to float.

Incidentally, your C++ program doesn't allocate the array.




More information about the Python-list mailing list