USING LOOPS IN PYTHON

Question

Q2.  Write a program to print all the values between 0 to 20 that aren’t divisible by 3 or 5 using continue .

in progress 0
Aman rathore 3 years 2 Answers 588 views Member 0

Answers ( 2 )

  1. Ans.
    for x in range(21):
    if (x % 3 == 0 or x % 5 == 0):
    continue
    print(x)

  2. for i in range(0,21):
    if i%3==0 or i%5==0 :
    continue
    print(i)

Leave an answer

Browse
Browse