English

Rewrite the following while loop into for loop. i = 10 while i<250: print i i = i+50

Advertisements
Advertisements

Question

Rewrite the following while loop into for loop.

 i = 10
while i<250:
     print i
     i = i+50
Code Writing
Advertisements

Solution

for i in range(10, 250, 50):
    print(i)
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 6. a) | Page 25
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×