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)