Using Nested If Function Python Syntax For If Else In Java