About Lesson
Q 1:- create a lambda function to calculate remainder
rem=lambda a,b:a%b print(rem(10,3)) Output 1 |
rem=lambda a,b:a%b a=int(input(“Enter 1st number “)) b=int(input(“Enter 2nd number “)) result=rem(a,b) print(“Remainder is : “,result) |
Q. 2:- find the Square of a number by using lambda function
sq=lambda a:a*a a=int(input(“enter any number “)) res=sq(a) print(“Square is “,res) |
sq=lambda a:a*a print(sq(5)) Output 25 |