Question: Let's review loops: remember that one of the basic elements a loop must have is a condition, which eventually lets the loop terminate. Infinite loops

Let's review loops: remember that one of the basic elements a loop must have is a condition, which eventually lets the loop terminate. Infinite loops can occur if you do not pay close attention when you set up your loop. Assume you have the following while loop: i=1 while i < 10 : print( i ) i=i+1 How many times does it execute? What will happen if you omit the statement i=i+1 in the above example?

Step by Step Solution

3.41 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

i1 while i 10 printi ii1 In the above given loop the initial ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!