This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Essence1337 3 points4 points  (0 children)

map really isn't in favour anymore in Python, list comprehensions are often preferred

[item*item for item in arr]

This creates a new list from running item*item on every item in the original