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
gameboy
Filter dictionaries with specific keys
Supermarket prices and stock
cache in python
ab.py
Problem Name: single_digit
PyClassInit
PyClaMInher
Цідило
python2 - division - 0