[python] How to do while loops with multiple conditions