In simple words, we can say that nested loops defines the idea of loops inside loop. It contains atleast 2 loops or even more.
Syntax
for i in list1:
for j in list2:
while(conditions):
Statements
Statements
Statements
First loop in hierarchy is termed as outer loop and others are termed as inner loops.
Nested loops are generally used in 2D arrays or list implementation and in various sorting algorithms like bubble sort, insertion sort, selection sort etc.
