Monday, 24 January 2022

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

Slip 26 Q 1

CODE :

area_square=lambda x: x*x       #area of square is a^2
side=int(input('Enter a side value of square : '))
print(area_square(side))

area_rectangle=lambda x,y:x*y   #area of rectangle is l*w
Length=int(input('Enter a Length value of rectangle : '))
Width=int(input('Enter a Width value of rectangle : '))
print(area_rectangle(Length,Width))

OUTPUT :




No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...