📜  Python Map 函数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:15.476000             🧑  作者: Mango

代码示例6
numbers = [1, 2, 3, 4, 5]
  
def square(num):
    return num*num
  
squares = list(map(square, numbers))
print(squares)
 
# Output
# [1, 4, 9, 16, 25]