use "if on" as stated in PEP-8 instead of "if on == 1"