call nested lambda

Question

How will you call this function?

def multiply(x):

return lambda y : y*x

solved 6
YashikaKhurana 4 years 1 Answer 1960 views Master 0

Answer ( 1 )

  1. a=multiply(7)

    print(a(8))

    Best answer
  2. P=multiply(7)

    print(p(8))

  3. step 1). pass_x=multiply(5) #this will give the output mentioned in step2
    step2). pass_x=lambda y: y*5
    step3).pass y to to lambda function .pass_x(3)
    step4).pass_x= lambda y: 3*5
    step5). answer will be 243.

Leave an answer

Browse
Browse