Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
L100
Attempt to break cpu limit
PyEnum
PyMap
16
Numbers padding in Python
check if any permutations of a word is a palindrome - python
pi1
Problem: binary
Aufgabe 16
Please log in to post a comment.