Exercise: Map function I
Here, we
use
the map function to apply double
to each element in numbers
. However, there's something missing. Complete the code.numbers = [1, 2, 3, 4, 5]
def double(x):
return x * 2
### adjust here ###
result = list(map(double, ))
print(result) # expected [2, 4, 6, 8, 10]
Python
Setting up Python environment...
Output