On Saturday, June 4, 2016 at 3:00:36 PM UTC+12, Steven D'Aprano wrote:
> You can exit a loop because you have run out of items to process, or you can
> exit the loop because a certain condition has been met.

But why should they be expressed differently?

    item_iter = iter(items)
    while True :
        item = next(item_iter, None)
        if item == None :
            break
        if is_what_i_want(item) :
            break
    #end while
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to