Articles → Python → Lambda Expression In Map Function In Python
Lambda Expression In Map Function In Python
Example
#!/usr/bin/python
# -*- coding: utf-8 -*-
mylist = [1, 2, 3, 4, 5]
def MyFunction(var):
return var * 2
print (list(map(lambda x: x * 2, mylist)))
Output
Posted By - | Karan Gupta |
|
Posted On - | Tuesday, May 14, 2019 |