87 of 100 menu

Python Taskbook Level 9.7

Given an arbitrary two-dimensional list:

[ [11, 12, 13, 14, 15], [21, 22, 23, 24, 25], [31, 32, 33, 34, 35], [41, 42, 43, 44, 45], [51, 52, 53, 54, 55], ]

Zero out the elements that are not on the diagonals:

[ [11, 0, 0, 0, 15], [ 0, 22, 0, 24, 0], [ 0, 0, 33, 0, 0], [ 0, 42, 0, 44, 0], [51, 0, 0, 0, 55], ]
enru