May-05-2017, 01:03 PM
(May-05-2017, 07:22 AM)buran Wrote: @volcano63, I don't understand what you mean that Python programmers don't have to write if 3 == x
Many C/C++ programmers acquire the habit to write if (3 == x)
instead of if (x == 3)
, because if you accidentally omit =
, the code will still compile - but the meaning will change.if (3 = x)
is illegal assignment, failing compilation. (May-05-2017, 07:22 AM)buran Wrote: and once again x = e += 1
is invalid, raising SyntaxError.
I thought I was enhancing your point, not arguing it.
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.