What are loop control elements for a while loop in python?

 

Answer:

The elements of a loop that control and govern its execution are called loop control elements.  These are four in number namely:  

  • Initialization expression - It gives an initial value  to the loop variable. This is done outside the loop. 
  • Test expression - decides whether the loop is to be executed or not.  
  • Body of the loop - consists of the statements  that are executed iteratively till the test  expression remains true.  
  • Update expression -  is a statement that  changes the value of the loop variable. This is  given within the body of the loop. 
Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo