Python Loop nesting
Python The language allows you to embed another loop in a loop body.
Python for Loop nesting syntax:
Python while Loop nested syntax：
You can embed other loop bodies in the loop body, such as the for loop in the while loop. Instead, you can embed a while loop in a for loop.
The following example uses a nested loop to output a prime number between 2 and 100: