Using Nested If Function Python Meaning