[wxpython-users] has_key() method versus the 'in' statement
by Chester other posts by this author
May 7 2008 1:05PM messages near this date
Re: [wxpython-users] Dialog v. Frame
|
Re: [wxpython-users] has_key() method versus the 'in' statement
my_dictionary = {"banana": 123, "orange": 456}
if my_dictionary.has_key("orange"): UGLY
...
if my_dictionary.has_key("orange") == False: UGLY
...
if not my_dictionary.has_key("orange"): UGLY
...
_____________________________________________________
if "orange" in my_dictionary: CLEAN
...
if "orange" not in my_dictionary: CLEAN
...
Thread:
Chester
Tim van der Leeuw
Phillip Watts
Kevin Ollivier
Chester
Phillip Watts
Tim Roberts
Chester
|