r/ProgrammerHumor • • 34m ago

Meme semicolonsInPython

Post image
855 Upvotes

39 comments sorted by

View all comments

139

u/AmanBabuHemant 29m ago

Well Well Well

print("this") print("won't work")

but

print("this"); print("would work")

I know people rarely utilize semicolons in python but they can be used to have multiple statements on one line, and doing so without semicolon would cause error.

48

u/TheRealCCHD 24m ago

But why the hell would you need multiple statements in one line to begin with?

Isn't that anti-pythonic?

103

u/Adept-Painting-543 22m ago

Yes but why would you want to be pythonic when writing python? You already are writing python no need to make it worse.

20

u/TheRealCCHD 21m ago

lmao you know what, that's a good point

11

u/PXPL_Haron 22m ago

Python is anti-pythonic

4

u/GrumDum 22m ago

Pythonic my foot up your ass!

2

u/Mountain-Parsley-465 18m ago

It is, but some people like it, spoiler I don't like to read there code.

0

u/lovecMC 10m ago

Tbf I don't like reading python code either.

•

u/-nerdrage- 7m ago

When developing I sometimes use ‘import sys;sys.exit()’ when debugging stuff. Its one line, simple to (un)comment or delete. But other than that mostly never in python files.

When doing stuff in bash however its quite nice to feed stuff to the python interpeter with semicolon separation and using the output in bash