In Python, how to define a while loop inline?