Continue in Python:

 for i in range(12):

  if(i==10):

    print("Skip the iteration")

    continue

  print("5 X", i, "=", 5 * i)


Result:5 X 0 = 0

5 X 1 = 5

5 X 2 = 10

5 X 3 = 15

5 X 4 = 20

5 X 5 = 25

5 X 6 = 30

5 X 7 = 35

5 X 8 = 40

5 X 9 = 45

Skip the iteration

5 X 11 = 55

In continue  iteration is exit out.

Comments

Popular posts from this blog

According to Data Science Topic-13 Modules

Functions in Python:

According to Data Science Topic-12 If else program examples