Using Nested If Function Python Programming