DEV Community

Cover image for Why is the semicolon allowed in this Python snippet?
Iano Njuguna
Iano Njuguna

Posted on

Why is the semicolon allowed in this Python snippet?

TL;DR: It's a design decision. I don't think Python needs this semicolon thing, but somebody thought it would be nice to have and added it to the language."

Python does not require semicolons to terminate statements. Semicolons can be used to delimit statements if you wish to put multiple statements on the same line.

Now, why is this allowed? It's a simple design decision. I don't think Python needs this semicolon thing, but somebody thought it would be…

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Retry later