• Skip to primary navigation
  • Skip to content
  • Skip to footer
listcomp Pro listcomp Pro 温故而知新
  • Posts
  • Categories
  • Tags
  • About

    Python: for-else with break

    September 28, 2017 less than 1 minute read

    Python Tips: 19. For - Else:

    The else clause executes when the loop completes normally. This means that the loop did not encounter any break.

    In addition, if an exception is raised in for without handling, else after this for won’t execute.

    Categories: Python

    Updated: September 28, 2017

    Share on

    X Facebook LinkedIn Bluesky
    Previous Next

    Comments

    You May Also Enjoy

    Python: Import Enum Uniformly before Comparison

    May 9, 2025 1 minute read

    This is not considered a bug in Enum but it’s quite subtle indeed.

    Python Structural Pattern Matching (match/case since Python 3.10)

    April 7, 2025 4 minute read

    0. Overview

    Ken Thompson’s NFA Simulation Algorithm

    April 2, 2025 4 minute read

    0. Retrospect

    Config Mermaid.js in Minimal Mistakes theme

    April 1, 2025 1 minute read

    best place to config Mermaid.js

    • GitHub
    • Feed
    © 2025 listcomp Pro. Powered by Jekyll & Minimal Mistakes.