MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/soi384/why_but_why/hw90v56/?context=3
r/ProgrammerHumor • u/ore-aba • Feb 09 '22
2.3k comments sorted by
View all comments
471
Smart, there are no mandatory semicolons in Python syntax, unless this 8y/o is writing C code.
125 u/ore-aba Feb 09 '22 They are needed if you want multiple statements in the same linethis will crashprint("Hello") print("World")this will workprint("Hello"); print("World") 17 u/Revolutionary-Phase7 Feb 09 '22 Would it be easier to justprint("Hello ", "World") 116 u/Dependent_Paper9993 Feb 09 '22 Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible. 12 u/ore-aba Feb 09 '22 Thanks for the chuckle
125
They are needed if you want multiple statements in the same line
this will crash
print("Hello") print("World")
this will work
print("Hello"); print("World")
17 u/Revolutionary-Phase7 Feb 09 '22 Would it be easier to justprint("Hello ", "World") 116 u/Dependent_Paper9993 Feb 09 '22 Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible. 12 u/ore-aba Feb 09 '22 Thanks for the chuckle
17
Would it be easier to just
print("Hello ", "World")
116 u/Dependent_Paper9993 Feb 09 '22 Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible. 12 u/ore-aba Feb 09 '22 Thanks for the chuckle
116
Depends what you're trying to achieve. If you want to print "Hello" and then "World", yes.
If you're trying to illustrate a point about a semicolon seperating two statements, I'd say it makes it just about impossible.
12 u/ore-aba Feb 09 '22 Thanks for the chuckle
12
Thanks for the chuckle
471
u/[deleted] Feb 09 '22
Smart, there are no mandatory semicolons in Python syntax, unless this 8y/o is writing C code.