I’m new to Python; trying to write a little script. I need to use the “not” operator. At first, I tried the nearly universal ! operator. Syntax error – that’s not it. So I open my handy Python in a Nutshell book, and look up the operators (pg 36). Sure enough, ! is not one of them. Hmm. So, I look in the index for “not”. “not” is not there. Could it be that Python has not got a not?
No, of course it does not not have a not. I found the answer on pg 50 – the not operator is aptly named “not” – e.g. “if not foo:”
Not funny? Not was not in the index!