About python while statement and pop()
Mark H Harris
harrismh777 at gmail.com
Thu Jun 12 13:10:54 EDT 2014
On 6/12/14 11:57 AM, Chris Angelico wrote:
> On Fri, Jun 13, 2014 at 2:49 AM, Mark H Harris <harrismh777 at gmail.com> wrote:
>> Consider this generator variation:
>>
>>>>> def poplist(L):
>> done = False
>> while done==False:
>>
>> yield L[::-1][:1:]
>> L = L[::-1][1::][::-1]
>> if len(L)==0: done=True
>
> Why not just "while L"? Or are you deliberately trying to ensure that
> cheating will be detectable?
;-)
More information about the Python-list
mailing list