Lambda Function with map()

 
#Code to calculate the square of each number of a list using the map() function  
  
numbers_list = [2, 4, 5, 1, 3, 7, 8, 9, 10]  
  
squared_list = list(map( lambda num: num ** 2 , numbers_list ))  
  
print( squared_list )  


OUTPUT:

[4, 16, 25, 1, 9, 49, 64, 81, 100]