DEV Community

Cover image for When is semicolon use in Python considered "good" or "acceptable"?
Iano Njuguna
Iano Njuguna

Posted on

When is semicolon use in Python considered "good" or "acceptable"?

PEP 8 is the official style guide and says:

Compound statements (multiple statements on the same line) are generally discouraged.

(See also the examples just after this in the PEP.)

While I don't agree with everything PEP 8 says, if you're looking for an authoritative source, that's it. You should…

Top comments (2)

Collapse
 
sreno77 profile image
Scott Reno

Never

Collapse
 
ianonjuguna profile image
Iano Njuguna

That's a concise answer 😆