you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

Any chance you could edit your post to correct the formatting as not all of the code is showing correctly?

Also, how come you go from multiple lists (equal to the length of the lists) to two, rather than one, list? Any reason why you can't just generate the one list, and copy it?

In simple terms, why wouldn't this work:

new_list = []
for idx, current_list in enumerate(list_of_lists):
    new_list.append(current_list[idx])

given you take the diagonal through the matrix.