I was writing a python script and errored out with invalid syntax on:
if (val && v==2):
I had forgotten a difference between MEL and Python operators.
MEL &&, Python and
MEL ||, Python or
So, I changed the code to:
if (val and v==2):
and my script worked as expected. With that, I will refer to my last post about different style quotes and readability – I think the python way is a bit nicer.
Speaking of “bit” - in Python, & is the bitwise and. | is the bitwise or.
Did this make you any wiser?
and or
In order to post any comments, you must be logged in!
Maybe the best answer is to point you to the What's New in python 2.5:
http://docs.python.org/whatsnew/pep-308.html
Thanks to Steven for pointing it out to me
http://docs.python.org/whatsnew/pep-308.html
Thanks to Steven for pointing it out to me
I've been stumbling over python's version of a ? b : c
Page 1 of 1 pages



