[Tutor] 'or' in assignment (not if statement)?

Alex Hall mehgcap at gmail.com
Fri Dec 10 01:51:53 CET 2010


Hi all,
I am reading the source of a project I hope to help with
(http://www.qwitter-client.net). I sometimes see something like:
val=val or 1
I am guessing that val is an int. If val==0, the 'or' kicks in and
val=1, else the or is not needed and val=val. Am I close? Can other
words or symbols be used in contexts where one would not normally
think of them?
Thanks.

-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap


More information about the Tutor mailing list