How do you check for a specific game engine property with python? (2.7x only)
sensor = cont.sensors["Ray"]
if sensor.positive:
    trigger = sensor.hitObject
    if "property" in trigger:
        # do something


You may also want to check if the property exists and get it (all in one lookup), This can be done using get a fallback value to avoid try/except.

sensor = cont.sensors["Ray"]
if sensor.positive:
    trigger = sensor.hitObject
    prop = trigger.get("property", None)
    if prop is not None:
        # do something


This style of access is the same thats used in Python dictionaries. eg:

dct = {"a": 2}
if "a" in dct:
    print("found")

val = dct.get("b", 2)
print(val)  # -&gt; 2 (or the value)