Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Data structures
#python 2.7.12 array = [ [1, 2, 3] , [4, 5, 6], [7, 8, 9]] print "Input matrix :" for a in array: print a rows = len(array) cols = len(array[0]) no_diagonals = rows + cols - 1 print no_diagonals k = 0 print "Diagonal Matrix:" while k < no_diagonals: for i in range(rows): for j in range(cols): if i+j== k: print array[j][i], k = k +1 print
run
|
edit
|
history
|
help
0
Boauth
0dd08b977895229d09b4848e467a4e10162ed345de0b245922b3505909d33ead
asxsd
Replace
epicoaosdsoasd
PyPropertyDecorator
PyProperty
Aisha Lesson 2
Array Example
asd