DEV Community

Discussion on: No Need, but some use semi-colon in Python. Here's Why!

Collapse
 
moopet profile image
Ben Sinclair

You can do that, but

Sparse is better than dense.
Readability counts.

:)

Collapse
 
areeburrub profile image
Areeb ur Rub

Correct Ben, Python page also mentioned this in docs

Avoid having multiple statements on a single line.

Though the language definition allows one to use a semi-colon to delineate statements, doing so without reason makes one’s code harder to read. Typically violated with the previous rule.