How to set and check a boolean flag in python

boolean, python

Solution

You're looking for `True` and `False` (note the capitals). Also the more pythonic way to write the last line is `if not loggedDocument` instead of `if loggedDocument == False`. Edit: And BTW, the `println` is not Python a builtin Python function; are you looking for `print()`?

Problem

I'm trying to do something like this with a boolean: ``` /* ... other stuff */ loggedDocument = false for line in inFile: if (line.find( /*something*/ ) != -1): println("FOUND DOCUMENT: %s" % line) loggedDocument = true if (loggedDocument == false): /* do something else */ ``` But I keep getting invalid syntax errors. I googled but couldn't find a simple boolean example, any ideas?

Original source