While loop

What is While loop in Python?
  • A While loop in Python is used to execute a set of statements/ iterate over a block of code repeatedly as long as the given condition is true.
  • While loop is preferred when we don't know the number of iterations.
Syntax:
                    while condition:
                            body statements
  • The body statement of the while loop is separated from the rest of the code using indentation [tab].

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...