Friday, 17 December 2021

Python-Slip 26-A-Write an anonymous function to find area of square and rectangle.

 Write an anonymous function to find area of square and rectangle. 

 square = lambda x: x**2

print(f'Area of Square is:-{square(5)}')

 rectangle_area = lambda x, y: x * y

print(f'Area of Rectangle (4, 5) is {rectangle_area(4, 5)}')