Anonymous/Lambda Functions In Python

 

# Lambda functions or anonymous functions

# def add(a, b):
# return a+b

# minus = lambda x, y: x-y

# def minus(x, y):
# return x-y
#
# print(minus(9, 4))


# a = [[1, 14], [5, 6], [8, 23]]
# a.sort(key=lambda x: x[1])
# print(a)

Comments

Popular posts from this blog

MAP FILTER AND REDUCE FUNCTION IN PYTHON

Writing Appending to a File

Recursions: Recursive Vs Iterative Approach