Loops in Python - What are loops and how to code while loop, for loop, nested loops in Python?

Loops are set of instructions that are continuously executed until the mentioned condition is met. 

Following are the types of Loops in Python - 

1. while Loop - 

General structure of while loop - 

while condition:

     statements

 

2. for Loop

General structure of for loop - 

for target in object: 

     statements 

else: 

     statements