Here is a comparison of Java and Python for the if statement. We are preparing our Python scripts to parallel (at least as much as possible) the Java class from Logical Operations. So we may as well publish them for our reference as well as anyone else who might be interested. It also includes the pseudocode. See screenshots on box.com.