Loop in Python

  • Loop is a command which means repeat again an again using logics.
  • In python loops are two types:
    • while loop
    • for loop

    While loop in python

    • It is an entry-controlled looping statement.
    • It is used to repeat a block of statements until the condition becomes True.

    Syntax:

    while (condition):
     statement
     increments/decrements

    Example of while loop

    English Hindi