Articles → Python → Lambda expression in map function

Lambda expression in map function






Example


mylist = [1,2,3,4,5]

def MyFunction(var):
    return var*2

print(list(map(lambda x: x*2 , mylist)))



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, May 14, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250