Using Nested If Function Python Syntax And Semantic