how to specify if a button is in false mode in script so i just need to know if and how to do this. example one: (all of this will be in blender game engine)

import bge

def main():

cont = bge.logic.getCurrentController()
own = cont.owner

right = cont.sensors ["right"]
left = cont.sensors ["left"]
gas = cont.sensors ["gas"]

if gas.negative:
    if left.negative:
        if right.negative:
            own ["rotation"] += 0.1
else:
    own ["rotation"] = 0


so i just need to know how to say "if im not pressing w, do this" INSTEAD of doing this "if im pressing w do this" normally you do if w.positive:
     blah blah blah...

please help and thanks in advance
Just put not in the if.

from bge import logic
def main():
    cont = logic.getCurrentController()
    own = cont.owner

    right = cont.sensors ["right"]
    left = cont.sensors ["left"]
    gas = cont.sensors ["gas"]

    if not gas.positive:
        if not left.positive:
            if not right.positive:
                own ["rotation"] += 0.1
    else:
        own ["rotation"] = 0