Use iter() instead of while True