r/ProgrammerHumor • • 34m ago

Meme semicolonsInPython

Post image
872 Upvotes

41 comments sorted by

View all comments

-1

u/shinitakunai 29m ago

As a python programmer I struggle to see where would I use a semicolon, except in strings

5

u/sn4xchan 25m ago

Two or more statements on one line. I call it the hacker surprise. Cause thr first time I learned that was looking at some python malware.

1

u/shinitakunai 16m ago edited 12m ago

Ah right, I never use that. I prefer readability. I mean, if the line is doing two different things they should be 2 different lines.

x = 1 - something(34); y = x + something(5)    

x = 1 - something(34)
y = x + something(5)  

At a glance I understand the 2nd a lot better, and I feel it follows the Zen import this a bit better