Home > Net >  Two-dimensional array about python transposed exchange
Two-dimensional array about python transposed exchange

Time:09-19

To solve the

As shown in figure as input sample and then lose out to their ranks the appearance of exchange
How to implement python3.5

CodePudding user response:

A two-dimensional array of shaft exchange, can be easy exchange assignment way

CodePudding user response:

Matrix=[[1, 2, 3, 4], [5, 6, 7, 8], [9, 1, 2, 3]]
Print ([[row [I] for the row in matrix] for I in range (len (matrix [0]))))

CodePudding user response:

Str_in1=input ()
Nums1=[int (n) for n in str_in1. The split ()]
Str_in2=input ()
Nums2=[int (n) for n in str_in2. The split ()]
Str_in3=input ()
Nums3=[int (n) for n in str_in3. The split ()]
A=len (nums1)
B=len (nums2)
C=len (nums3)
If (b>=1) :
For I in nums2] [: - 1:
Print (STR (I) + ", "end=" ")
Print (nums2 [1])
The else:
Print (" ")
If (a>=1) :
For I in nums1] [: - 1:
Print (STR (I) + ", "end=" ")
Print (nums1 [1])
The else:
Print (" ")
If (c>=1) :
For I in nums3] [: - 1:
Print (STR (I) + ", "end=" ")
Print (nums3 [1], the end="")
The else:
Print (" ")
  • Related