<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt" -->

---
title: Python’s Most Confusing Features Actually Make Perfect Sense
description: An explanation of three commonly misunderstood Python features: the absence of a do...while loop, the else clause on try blocks, and the else clause on...
canonical: https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Python’s Most Confusing Features Actually Make Perfect Sense | daily.dev
og:description: An explanation of three commonly misunderstood Python features: the absence of a do...while loop, the else clause on try blocks, and the else clause on...
og:url: https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt
og:image: https://api.daily.dev/og/posts/NphQF7HLt.png
og:image:alt: Python’s Most Confusing Features Actually Make Perfect Sense
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Python’s Most Confusing Features Actually Make Perfect Sense

**[Medium](https://daily.dev/sources/medium_js)** · 5 min read · 0 upvotes · 0 comments

## Summary

An explanation of three commonly misunderstood Python features: the absence of a do...while loop, the else clause on try blocks, and the else clause on for/while loops. Each feature is explained through Python's design philosophy of keeping the language minimal and readable. The else keyword in loops and try blocks follows a unified principle: it runs only when the block completes without an early interruption (break or exception).

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dranimeshsharma.medium.com/pythons-most-confusing-features-actually-make-perfect-sense-a3298bc49526>

## Questions this post answers

### Why doesn't Python have a do while loop?

Python omits a dedicated do-while loop to keep the language simple, following its philosophy of having one obvious way to do things. Instead, developers write while True combined with an if condition and a break statement, which runs the loop body at least once just like a do-while loop would, without adding an extra keyword.

_Developers comparing loop constructs across languages can find similar language-design breakdowns on daily.dev._

### When does the else block run after a try except statement in Python?

The else block after a try/except statement runs only if no exception occurred in the try block. This lets code that might fail stay separate from code that should run only after success, such as reading a file only if opening it succeeded, making error handling clearer and reducing accidental bugs.

_Anyone writing safer exception handling in Python can track patterns like this on daily.dev._

### What does the else clause mean on a for loop or while loop in Python?

The else clause on a for or while loop runs only when the loop finishes without hitting a break statement, not simply when the loop condition becomes false. For example, searching a list for a target value, the else prints 'Not found' only if the loop checks every item and never breaks, avoiding the need for a separate found flag variable.

_Developers puzzling over for-else and while-else behavior can revisit explanations like this on daily.dev._

## Similar posts on daily.dev

- [Break Out of Loops With Python's break Keyword – Real Python](https://daily.dev/posts/break-out-of-loops-with-python-s-break-keyword-real-python-dkyqc4nxx) · Planet Python · 1 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#language-design](https://daily.dev/tags/language-design)

[View this post on daily.dev](https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Python’s Most Confusing Features Actually Make Perfect Sense","url":"https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt"},"datePublished":"2026-07-24T10:11:50.947Z","dateModified":"2026-09-14T08:41:31.947Z","description":"An explanation of three commonly misunderstood Python features: the absence of a do...while loop, the else clause on try blocks, and the else clause on...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d0b0ea4ca084c756a0486a96997a67c2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d0b0ea4ca084c756a0486a96997a67c2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,language-design","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Python’s Most Confusing Features Actually Make Perfect Sense"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/python-s-most-confusing-features-actually-make-perfect-sense-nphqf7hlt#faq","mainEntity":[{"@type":"Question","name":"Why doesn't Python have a do while loop?","acceptedAnswer":{"@type":"Answer","text":"Python omits a dedicated do-while loop to keep the language simple, following its philosophy of having one obvious way to do things. Instead, developers write while True combined with an if condition and a break statement, which runs the loop body at least once just like a do-while loop would, without adding an extra keyword. Developers comparing loop constructs across languages can find similar language-design breakdowns on daily.dev."}},{"@type":"Question","name":"When does the else block run after a try except statement in Python?","acceptedAnswer":{"@type":"Answer","text":"The else block after a try/except statement runs only if no exception occurred in the try block. This lets code that might fail stay separate from code that should run only after success, such as reading a file only if opening it succeeded, making error handling clearer and reducing accidental bugs. Anyone writing safer exception handling in Python can track patterns like this on daily.dev."}},{"@type":"Question","name":"What does the else clause mean on a for loop or while loop in Python?","acceptedAnswer":{"@type":"Answer","text":"The else clause on a for or while loop runs only when the loop finishes without hitting a break statement, not simply when the loop condition becomes false. For example, searching a list for a target value, the else prints 'Not found' only if the loop checks every item and never breaks, avoiding the need for a separate found flag variable. Developers puzzling over for-else and while-else behavior can revisit explanations like this on daily.dev."}}]}
```

