Write lambda function - python

0 votes
How do I write this using lambda function?
May 23 in Python by Tanmay
11 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Lambda equivalent for this section of python code would be the following:

map(lambda x : x*2, [1, 2, 3, 4]) #Output [2,4, 6, 8]
answered May 23 by Umer

Related Questions In Python

0 votes
1 answer

Python: Lambda function in List Comprehensions

The first one create a single lambda ...READ MORE

answered Aug 27, 2018 in Python by Priyaj
• 56,140 points
75 views
0 votes
1 answer

What is the use of raw_input function in Python?

raw_input fuction is no longer available in ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
46 views
0 votes
1 answer

What does ' -> ' mean in Python function definitions?

It's a function annotation. In more detail, Python 2.x ...READ MORE

answered May 22, 2018 in Python by charlie_brown
• 7,710 points
30 views
+1 vote
1 answer

What is the function for Factorial in Python

Easiest way: math.factorial(x) (available in 2.6 and ...READ MORE

answered Aug 21, 2018 in Python by Priyaj
• 56,140 points

edited Aug 21, 2018 by Omkar 74 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
55 views
+4 votes
6 answers
0 votes
1 answer

Difference between a normal def defined function and lambda function in python?

Have a look at this code: # Python ...READ MORE

answered May 20 in Python by Trisha
26 views
0 votes
1 answer

Convert python code into lambda function

This should work: add = lambda x, y ...READ MORE

answered May 23 in Python by Payal
14 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.