English

How many times are the following loop executed? i = 4 while (i>=4): print i i+ = 10

Advertisements
Advertisements

Question

How many times are the following loop executed?

 i = 4
while (i>=4):
     print i
     i+ = 10
Very Short Answer
Advertisements

Solution

The value of i keeps increasing, so i >= 4 always remains true.

Infinite times (Infinite loop)

shaalaa.com
  Is there an error in this question or solution?
Chapter 1: Review of Phython - EXERCISE [Page 25]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 1 Review of Phython
EXERCISE | Q 4. d) | Page 25
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×