Course Content
What is Python?
Introduction of Python and Its setup
0/2
Control Statement
Control statements are used to control the flow of execution depending upon the specified condition/logic.
0/4
File Handling
File handling is an important component of any application. Python has multiple functions for creating, reading, updating, and deleting files.
0/2
Examples
Following are the examples of python scripts to try hands-on, you are ready to start your python journey.
0/7
Python
About Lesson

1)While Loop

While Loop It is used to execute a block of a statement till a given condition is true. And when the condition becomes false, the control will exit from the loop. Every time at the beginning of the loop it checks the condition. For Loop It is used to iterate over items of any sequence, such as a list or a string. Nested For Loop For loop within for loop is what we mean by nested for loops.

x=1  
while x<=4 :  
      print(x)  
      x = x+1 

In the above code, we are printing all the values from 1 to 4.

2)For Loop

It is used to iterate over items of any sequence, such as a list or a string.

for i in range (3,5):  
      print(i) 

In the above code, we are printing numbers from 3 to 5.

3)Nested For Loop

For loop within for loop is what we mean by nested for loops.

for i in range (1,3):  
    for j in range(1,11):  
          k=i*j  
          print(k, end = ' ')  
    print() 

In the above code, we are running our loop firstly from 1 to 3 and then for each iteration running for another 10 times.