3 ms·
Python is not unique in this regard. Consider a functional approach, where you leave the original list intact and construct a changed one.
by Luyt 16y ago
Python is not unique in this regard. Consider a functional approach, where you leave the original list intact and construct a changed one.
- koenigdavidmj 16y agoList comprehensions or map are the way that a Pythonista would do this: [transform(x) for x in my_list] map(transform, my_list)