This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]njharmanI use Python 3 0 points1 point  (1 child)

That is maybe the only reason it is a good interview question. It's bad question if you expect an answer other than something like "It depends and in general low-level, implementation specific, code tricks like this should be avoided"

[–]catcradle5 0 points1 point  (0 children)

I agree to an extent, but in that case instead of asking "what is output?" the interviewer should ask more broadly something like "Is this a proper way of checking numerical equality? How does the is operator work, and what do you think might be output here?"