Python continue Statement

Rumman Ansari   Software Engineer   2021-01-11   5422 Share
☰ Table of Contents

Table of Content:


With the continue statement we can stop the current iteration of the loop, and continue with the next:

Example

Do not print atnyla:

Code:


name = ["python", "atnyla", "code"]
for x in name:
  if x == "atnyla":
    continue
  print(x) 

Output:

 
 python 
 code