English

Rewrite the following while loop into for loop. i=88 while(i>=8): print i i- = 8

Advertisements
Advertisements

Question

Rewrite the following while loop into for loop.

i=88
while(i>=8):
     print i
     i- = 8
Code Writing
Advertisements

Solution

for i in range(88, 7, -8):
    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. b) | Page 25
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×