problem with lists
Uwe Schmitt
uwe.schmitt at procoders.net
Thu Sep 12 09:01:33 EDT 2002
Sean 'Shaleh' Perry <shalehperry at attbi.com> wrote:
>> Manuel
> You want to use :
> if fields[3:4] not in domains:
> domains.append(fields[3:4])
> .index() only works if the item is actually in the list.
At least you should wrap the line with .index in a try/except pair...
But the solution with "in" is preferable.
Greetings, Uwe
--
Dr. rer. nat. Uwe Schmitt Computer science is no more about Computers,
uwe.schmitt at procoders.net than astronomy is about telescopes. (Dijkstra)
http://www.procoders.net
More information about the Python-list
mailing list