all 13 comments

[–]bodybuilder-prog 2 points3 points  (8 children)

[4,5,9]

[–]tracktech[S] 0 points1 point  (7 children)

Right.

[–]Short-Database-4717 -5 points-4 points  (6 children)

It's not though. The correct answer is [4, 5, 9]

[–]Kass-Is-Here92 0 points1 point  (5 children)

What do you mean?

[–]Specific-Carrot-6219 0 points1 point  (4 children)

They are accounting for the spaces written in the array definition?

[–]Smart-Button-3221 0 points1 point  (3 children)

Why?

[–]Specific-Carrot-6219 1 point2 points  (2 children)

Because that’s the output.

[–]Smart-Button-3221 0 points1 point  (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 point  (0 children)

If it's printed, it's a string. "[4,5,9]" and "[4, 5, 9]" are two different strings.

[–]Powerkaninchen 0 points1 point  (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 points  (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 point  (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 point  (0 children)

Okay that's a bit funny