Python Use Variable In Nested Ifs In Java