PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Python · Theory

continue in Python

← All stacks

Theory

24/268

continue in Python

continue skips the rest of this loop round and jumps to the next item. The loop does not end. Useful to ignore zeros, empty names, or a value you don’t want to print. for n in [1, 0, 2]: if n == 0: continue; print(n) → 1 then 2. Zero never prints, but 2 still does.

break would have stopped after zero and never printed 2. Same loop, two keywords, two outputs — that comparison is the viva.

continue in Python — output — 1, 2, 4, 5. 3 is skipped.

Exam tip

continue skips; break exits.

Example

# continue
for i in range(1, 6):
    if i == 3:
        continue
    print(i)

continue in Python — output: 1, 2, 4, 5. 3 is skipped.

Short notes

  • DefSkip this round. Loop goes on.
  • RuleFilter bad values.
  • Diffbreak exits completely.

Questions

1

Explain continue as if you are teaching a junior — definition, then one tiny script.

2

What does the example print, and why?

3

What mistake do freshers make with continue?

Previous← while Loop in PythonNextbreak in Python →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.