List of Numbers

Jim Richardson warlock at eskimo.com
Tue Apr 8 05:31:42 EDT 2003


On Sat, 05 Apr 2003 20:13:45 +0100,
 Simon Faulkner <news at titanic.co.uk> wrote:
> I have a list of about 5000 numbers in a text file - up to 14 digits
> each.
> 
> I need to check for duplicates.
> 
> What would people suggest as a good method?
> 
> Simon

I'd use sort|uniq, but I don't know if that's available for MS type osen. 

In python, just stuff them all in a dictionary, any repeats, will be
eliminated. But this is rather crude and probably slow. But it would
work.

-- 
Jim Richardson         http://www.eskimo.com/~warlock

Linux, because eventually, you grow up enough to be trusted with a fork()




More information about the Python-list mailing list