Python Nested For loop


Python Nested For loop

Program
# a for loop will executed 3 time i.e from 1 to 3 # b for loop will executed 3 time i.e from 2 to 4 # Hence total time loop wil be executed is 3 * 3 = 9 for a in range(1,4): for b in range(2,5): print("a="+str(a)+" b="+str(b))
Input
Output