[Tutor] Using string.strip()

alan.gauld@bt.com alan.gauld@bt.com
Wed, 8 Aug 2001 12:10:11 +0100


> Alternatively, try list comprehensions:
> responses = [item.strip() for item in responses]

Or the easier to read(in this case) map:

responses = map(string.strip,responses)

comprehensions are OK if dealing with multiple variables 
but for simple mappings like this I much prefer map() 
- it always seems much less like black magic!

Alan g