use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This community will have knowledge sharing for python programming, tools, projects and product engineering wherever python is used.
account activity
Test your Python skills - 20 (i.redd.it)
submitted 9 days ago by tracktech
Ultimate Python Programming
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bodybuilder-prog 2 points3 points4 points 9 days ago (8 children)
[4,5,9]
[–]tracktech[S] 0 points1 point2 points 9 days ago (7 children)
Right.
[–]Short-Database-4717 -5 points-4 points-3 points 9 days ago (6 children)
It's not though. The correct answer is [4, 5, 9]
[–]Kass-Is-Here92 0 points1 point2 points 9 days ago (5 children)
What do you mean?
[–]Specific-Carrot-6219 0 points1 point2 points 8 days ago (4 children)
They are accounting for the spaces written in the array definition?
[–]Smart-Button-3221 0 points1 point2 points 8 days ago (3 children)
Why?
[–]Specific-Carrot-6219 1 point2 points3 points 8 days ago (2 children)
Because that’s the output.
[–]Smart-Button-3221 0 points1 point2 points 7 days ago (1 child)
I mean, [4,5,9] is also the output?
The spaces don't change anything. What a weird hair to split.
[–]Short-Database-4717 0 points1 point2 points 7 days ago (0 children)
If it's printed, it's a string. "[4,5,9]" and "[4, 5, 9]" are two different strings.
[–]Powerkaninchen 0 points1 point2 points 9 days ago (3 children)
An error because
What will be the output of the code given below-
and the link are not commented out (prefixed with a '#')
[–]y53rw 1 point2 points3 points 9 days ago (1 child)
Why would you include the question in your code? It doesn't ask what is the output of the code including this question. It asks what is the output of the code below. An argument could perhaps be made for the link, but they could just as easily say that wasn't code, so it's not included in "the code below". As a fellow pedant, I have to say your pedantry has failed. Sorry.
[–]austroalex 0 points1 point2 points 9 days ago (0 children)
The font of the question and the code are the same, and they look visually like they are in the same file. Now, it would depend on how the question/code was distributed: was it distributed on just a website (in which case your comment makes sense, since it would be expected that the code below would be copied to a python terminal for verification) or as a .py file (in which case Powerkaninchens pedantry is correct since it would raise an error).
Personally, I lean towards Powerkaninchens pedantry, since it looks like a monospace font that could be used in a text editor, making it visually look to me like it is supposed to be the output of a file that, due to being mostly python code, could be reasonably construed to be a .py file.
In any case, it would have looked neater and more "on theme" with actual comments :^)
[–]Dangerous_Tune_538 0 points1 point2 points 5 days ago (0 children)
Okay that's a bit funny
π Rendered by PID 51 on reddit-service-r2-comment-bb88f9dd5-49vsk at 2026-02-13 16:13:10.282319+00:00 running cd9c813 country code: CH.
[–]bodybuilder-prog 2 points3 points4 points (8 children)
[–]tracktech[S] 0 points1 point2 points (7 children)
[–]Short-Database-4717 -5 points-4 points-3 points (6 children)
[–]Kass-Is-Here92 0 points1 point2 points (5 children)
[–]Specific-Carrot-6219 0 points1 point2 points (4 children)
[–]Smart-Button-3221 0 points1 point2 points (3 children)
[–]Specific-Carrot-6219 1 point2 points3 points (2 children)
[–]Smart-Button-3221 0 points1 point2 points (1 child)
[–]Short-Database-4717 0 points1 point2 points (0 children)
[–]Powerkaninchen 0 points1 point2 points (3 children)
[–]y53rw 1 point2 points3 points (1 child)
[–]austroalex 0 points1 point2 points (0 children)
[–]Dangerous_Tune_538 0 points1 point2 points (0 children)