CBSE Class 10 Computer Applications Question 15 of 26

Python Conditionals and Loops — Question 6

Back to all questions
6
Question

Question 5(b)

Rewrite the following code fragments using for loop

i = 100
while (i > 0) :
    print i
    i -= 3
Answer
for i in range(100, 0, -3) :
    print (i)