Python Loops

 RPA | Python Loops| Jupyter Notebook - Part-48

Python Loops - In this blog we will discuss about the various loops such as for, while in python using Jupyter Notebook. So let us look into each of the loops in detail one by one.

So let us look at each of the above mentioned looping statements in detail one by one.

  • For Loop - The for loop is used to iterate over a sequence i.e. either list, tuples, dictionary, set or string. With the help of for loop we can execute the sets of statements that are present inside the for loop. So let us look at the syntax of using for loop in python which is as given below:
For Loop Syntax:
                                for some_variable in source_variable:
                                    set of statements

Now we will look into the examples of using for loop in python as follows:

For Loop Python


  • While Loop - With the while loop we can execute set of statements as long as the condition in it is true. So let us look at the syntax of using while loop which is as given below:
While loop syntax:

                                   while condition:
                                      statement 1
                                      statement 2
Now we will look at the example of using while loop in python which is as follows:

While Loop Python


So with that we have come to the end of our blog where we discussed how we can use loops in python with the help of Jupyter Notebook. 

If you have any queries then please raise your queries in the comment section and I will be more than happy to answer all of your queries.

Please go through the article and provide your valuable feedback as the feedback that you share really matters the most to me.

Comments

Post a Comment

If you have any doubts, please letme know.