Java While Loop Boolean Condition In Python