#Example 1
print("---------->>>>example 1:# Python code to show example of continue statement ")
print(" ")
# looping from 10 to 20
for iterator in range(10, 21):
# If iterator is equals to 15, loop will continue to the next iteration
if iterator == 15:
continue
# otherwise printing the value of iterator
print( iterator )
print("============================================================")
#Example 2
print("---------->>>>example 2:# # Creating a string ")
print(" ")
# prints all letters except 'a' and 't'
i = 0
str1 = 'javatpoint'
print("str1 value is:", str1)
while i < len(str1):
if str1[i] == 'a' or str1[i] == 't':
i=i+1
continue
print('Current Letter :', str1[i])
i=i+1
print("---------->>>>example 1:# Python code to show example of continue statement ")
print(" ")
# looping from 10 to 20
for iterator in range(10, 21):
# If iterator is equals to 15, loop will continue to the next iteration
if iterator == 15:
continue
# otherwise printing the value of iterator
print( iterator )
print("============================================================")
#Example 2
print("---------->>>>example 2:# # Creating a string ")
print(" ")
# prints all letters except 'a' and 't'
i = 0
str1 = 'javatpoint'
print("str1 value is:", str1)
while i < len(str1):
if str1[i] == 'a' or str1[i] == 't':
i=i+1
continue
print('Current Letter :', str1[i])
i=i+1
---------->>>>example 1:# Python code to show example of continue statement
10
11
12
13
14
16
17
18
19
20
============================================================
---------->>>>example 2:# # Creating a string
str1 value is: javatpoint
Current Letter : j
Current Letter : v
Current Letter : p
Current Letter : o
Current Letter : i
Current Letter : n