| View previous topic :: View next topic |
| Author |
Message |
Klimapol
Joined: 27 May 2006 Posts: 134
|
| Hello, I have a list of strings and need change each string the same way, there are four different changes I need to apply. Right now I append each changed item to a new list. Is there a better way? |
| |
|
|
|
|
autos06
Joined: 13 May 2006 Posts: 123 Location: New York
|
Make a function for it, and map it over the list, e.g.: mylist = map(change, mylist)
Depending on the nature of changes, an LC/generator expression may be more appropriate. |
| |
|
|
Klimapol
Joined: 27 May 2006 Posts: 134
|
| autos06, thank you I will try that. |
| |
|
|
|
|