Python Nested Loop

In this, a loop can be nested within another loop.


Syntax of Nested loop

for variable in sequence
	for variable in sequence
		statements
	statements


Example of Nested loop

>>> for row in range(0, 1):
	for col in range(1, 5):
		print("*" * col)

		
*
**
***
****


Python nested loop

Output of the above code
Python nested loop





Read more articles


General Knowledge



Learn Popular Language