> 1. How can I easily strip out the newline characters from the 
> elements
> of cleanedlist?

You can use the string strip() method.

> 2. Is there a better way to achieve my objective (ie. a list method
> for generating the cleaned list?)

You can convert the list to a Set.

>>> L = [1,2,1,3,4,2]
>>> s = set(L)
>>> s
set([1, 2, 3, 4])
>>>

HTH,

Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to