Possible mixed indentation in Python?
Looking at this question, I tried OP's the code on my machine. Here are a text version and a screenshot: What just happened? This supposed to be a square function, and it is implemented correctly. To be sure, I copy-pasted the code, and tried it again: Well, I can't see any difference between these versions of square , but only the latter works. The only reason I can think of is that I may have mixed tabs and spaces, so the return statement is actually indented, and so the loop is executed exactly once. But I could not reproduce it, and it looks like an unbelievable flaw in the interpreter's