What are uses of lambda?
Submitted by: AdministratorIt used to create small anonymous functions at run time. Like e.g.
def fun1(x):
return x**2
print fun1(2)
it gives you answer 4
the same thing can be done using
sq=lambda x: x**2
print sq(2)
it gives the answer 4
Submitted by: Administrator
def fun1(x):
return x**2
print fun1(2)
it gives you answer 4
the same thing can be done using
sq=lambda x: x**2
print sq(2)
it gives the answer 4
Submitted by: Administrator
Read Online Python Job Interview Questions And Answers
Top Python Questions
☺ | When do you use list vs. tuple vs. dictionary vs. set? |
☺ | What is python? |
☺ | What are uses of lambda? |
☺ | What is the optional statement used in a try except statement in Python? |
☺ | Do they know a tuple/list/dict when they see it? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |