Corrected code to be compatible with PEP-0008

1. Adjusted names of functions and variables.
2. Rewrite compare operations of boolean values.