Python Continue in if statement used to skip current iteration and instructs a loop to continue to the next iteration. Use continue statements within loops, usually after an if statement.
Continue in if statement Python
Simple example code uses a continue statement in Python to skip over part of a loop when a condition is met. When bb is equal to 2, Skip prints the second name and then continues iterating.
bb = ["Walter", "White", "Jesse", "Pinkman"] for cast in range(0, len(bb)): if cast == 2: continue else: print(bb[cast]) print("Counter is ",cast) print("Program Complete")
Do comment if you have any doubts or suggestions on this Python continue topic.
Note: IDE: PyCharm 2021.3.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.