KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

When do you need to use a nested loop?

Python Control Flow

2 Likes

Answer

A nested loop is used when a loop has to be programmed within another loop to perform a specific task. In a nested loop, the inner loop repeats for a number of times for each iteration of the outer loop. Nested loops are widely used in pattern printing.

Answered By

2 Likes


Related Questions