Question: ( Transpose ) Write a program called transpose.py that accepts m ( int ) and n ( int ) as command - line arguments, m

(Transpose) Write a program called transpose.py that accepts m (int) and n (int) as command-line arguments, mnfloats from standard input representing the elements of an mn matrix a, and writes to standard output the transpose of a. Recall that the transpose of an m-by-n matrix A is an n-by-m matrix B such that Bij = Aji, where 0 i < n and 0j. Accept m (int) and n (int) as command-line arguments Create an m n list a with all elements set to None (use stdarray.create2D()) For each i in [0,m)- For each j in [0,n)- Set a[i][j] to a float read from standard input (use stdio.readFloat()) Create an n m list c with all elements set to None (use stdarray.create2D()) For each i in [0,n)- For each j in [0,m)- Set c[i][j] to a[j][i] For each i in [0,n)- For each j in [0,m)- If j < m1, write c[i][j] with a space after; otherwise, write c[i][j] with a newline after

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!