Cannot reproduce:
>>> a=[1,2,3]
>>> a.index(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: 0 is not in list
On Thursday, 16 August 2012 08:31:51 UTC-5, simon wrote:
>
> Please can someone explain why, for a list of fields, that
> fields.index("anything at all") always evaluates to 0.
>
> For example this prints 23 and 0.
>
> t=db.todo
> fields = [t.id, t.customer, t.subject, t.completed, t.modified_by]
> if 23 in fields: print("23 is in there")
> print(fields.index("hshshshs"))
>
>
> ........what I want to do is remove a field from a list of fields
> <fields.remove(t.customer)> just removes the first field in the list.
>
>
>
--