On 30 Nov 2005 09:38:44 -0800 in comp.lang.python, "Tuvas"
<[EMAIL PROTECTED]> wrote:

>I am trying to write a function that holds a variable-length quene. The
>quene has 2 bits of information. At some point, I would like to remove
>bits of this quene, when they are completed. Is there a way to do this
>with something as follows?
>

the following might work...

>quene=[]
>quene.append((4,2))
>quene.append((3,6))
>if(4 in quene):            #Shows false, what's the correct syntax to
>show true?

 found = [t for t in queue if t[0] == 4]
 if found:

>    remove 4 from quene #(Not python code, not sure how to do this...)
     queue.remove(found[0])

HTH,
                                        -=Dave

-- 
Change is inevitable, progress is not.
-- 
http://mail.python.org/mailman/listinfo/python-list
  • Re: Quene Dave Hansen

Reply via email to