Skip to main content

Python Continue

Continue: It continues the flow of control.

Program:

a=10

b=21

for i in range(a,b):

    if(i==15):

        continue

    print(i)

Output:                                 

10

11

12

13

14

16

17

18

19

20

>>> 

Program-1:

a=10

while(a<=20):

    if(a==15):

        a=a+1

        continue

    print(a)

    a=a+1

Output:

10

11

12

13

14

16

17

18

19

20

Comments