python_map()函式
def square(x):
return x * x
numbers = [1, 2, 3, 4, 5]
squared_numbers = map(square, numbers)
for number in squared_numbers:
print(number)
python_map()函式
def square(x):
return x * x
numbers = [1, 2, 3, 4, 5]
squared_numbers = map(square, numbers)
for number in squared_numbers:
print(number)