Nested Loop Summing

Code

                total = 0
                lst = [[20, 12, 1, 5], [25, 10, 7], [9, 30]]
                for i in range(len(lst)): 
                    for j in range(len(lst[i])):
                        total += lst[i][j] 
            

Memory

total
0
i
0
j
0
lst
[
0:
[20, 12, 1, 5]
1:
[25, 10, 7]
2:
[9, 30]
]

Visual

Image 1
Image 2
Image 3