How to pass a list as an input of a function in Python
stackoverflow.com › questions › 35120620Feb 01, 2016 · import math map (lambda x: (math.pow (x,2)), [1,2,3]) This uses the map function, which takes a list and a function, and returns a new list where that function has been applied individually to each member of the list. In this case, it applies the math.pow (x,2) function to each member of the list, where each number is x.