#to add and multiply numbers using lambda in python
a=int(input("a number: "))
b=int(input("another number: "))
print("the sum is {}".format(lambda a,b:a+b))
print("the multiple is {}".format(lambda a,b:a*b))
i tried to add and multiply two numbers using lambda but i don't know why it shows error like this.I am a beginner to programming the error is :
the sum is <function <lambda> at 0x000001B6BF941B88>
the multiple is <function <lambda> at 0x000001B6BF893798>
lambdais a function. You need to actually call it to get a value... why are you usinglambdahere? You could do(lambda a,b: a+b)(a,b)but that's just a clumsy way of doinga + b...a+banda*b.