Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

skip to next iteration python

# program to display only odd numbers
for num in [20, 11, 9, 66, 4, 89, 44]:
    # Skipping the iteration when number is even
    if num%2 == 0:
        continue
    # This statement will be skipped for all even numbers
    print(num)
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #skip #iteration #python
ADD COMMENT
Topic
Name
8+8 =