Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python lambda

# Python code to illustrate cube of a number
# showing difference between def() and lambda().
def cube(y):
    return y*y*y
 
lambda_cube = lambda y: y*y*y
 
# using the normally
# defined function
print(cube(5))
 
# using the lambda function
print(lambda_cube(5))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python #lambda
ADD COMMENT
Topic
Name
4+2 =