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



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. 

Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class

Ask a doubt
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 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.