You are on page 1of 5

Code Python

lambda
x = lambda a : a + 10 x = lambda a, b : a * b
print(x(5)) print(x(5, 6))

Output : Output :
15 30
lambda
• x = lambda a, b, c : a + b + c Output ?
print(x(5, 6, 2))
map  map(fun, iter)
• fun : It is a function to which # Return double of n
def addition(n):
map passes each element of return n + n
given iterable.
• iter : It is a iterable which is to be # We double all numbers using map()
numbers = (1, 2, 3, 4)
mapped. result = map(addition, numbers)
print(list(result))

def my_function(fname, lname):
  print(fname + " " + lname)

my_function("Emil", "Refsnes")

You might also like