# Write a function to return the area of a rectangle - Python

Categories:
Viewed: 6 - Published at: a few seconds ago

### Write a function to return the area of a rectangle

``````def cal_area_rect(length, breadth):
``````

### Write a function to return the area of a square

``````def cal_area_square(side):
return side**2
``````

### Write a function to return the area of a rhombus with diagonals q1 and q2

``````def cal_area_rhombus(q1,q2):
return (q1*q2)/2
``````

### Write a function to return the area of a trapezium with base a base b and height h between parallel sides

``````def cal_area_trapezium(a,b,h):
return h*(a+b)/2
``````

### Write a function to return the area of a circle of raidus r

``````def cal_area_circle(r):
pi = 3.14
return pi*r**2
``````

### Write a function to return the circumference of a circle

``````def cal_circumference(r):
pi = 3.14
return 2*pi*r
``````

### Write a function to return the perimeter of a rectangle

``````def cal_perimeter_rect(length, bredth):
return 2*(length+bredth)
``````

### Write a function to return the perimeter of a triangle

``````def cal_perimeter_triangle(s1,s2,s3):
return s1+s2+s3
``````

### Write a function to return the perimeter of a square

``````def cal_perimeter_square(side):
return 4*side
``````

### Write a function to return the perimeter of an equilateral triangle

``````def cal_perimeter_eq_triangle(a):
return 3*a
``````

### Write a function to return the perimeter of a isoscales triangle

``````def cal_perimeter_iso_triangle(s1,s2):
return 2*s1+s2
``````

### Write a function to return the area of an ellipse

``````def cal_area_ellipse(minor, major):
pi = 3.14
return pi*(minor*major)
``````

### Write a function to return the lateral surface area of a cylinder

``````def cal_cylinder_lat_surf_area(height,radius):
pi=3.14
``````

### Write a function to return the curved surface area of a cone

``````def cal_cone_curved_surf_area(slant_height,radius):
pi=3.14
``````

### Write a function to return the total surface area of a cube of side a

``````def cal_surface_area_cube(a):
return 6*(a**2)
``````

### Write a function to return the total surface area of a cuboid of length l, bredth b and height h

``````def cal_surface_area_cuboid(l,b,h):
return 2*(l*b+b*h+h*l)
``````

### Write a function to return the surface area of a sphere

``````def cal_area_sphere(radius):
pi = 3.14
``````

### Write a function to return the surface area of a hemi-sphere

``````def cal_area_hemisphere(radius):
pi = 3.14
``````

### Write a function to return the total surface area of a cylinder

``````def cal_cylinder_surf_area(height,radius):
pi=3.14
``````

### Write a function to return the lateral surface area of a cone

``````def cal_cone_lateral_surf_area(height,radius):
pi=3.14
``````

### Write a function to return the volume of a cylinder

``````def cal_cylinder_volume(height, radius):
pi=3.14
``````

### Write a function to return the volume of a cone

``````def cal_cone_volume(height,radius):
pi=3.14
``````

### Write a function to return the volume of a hemi sphere

``````def cal_hemisphere_volume(radius:float)->float:
pi=3.14
``````

### Write a function to return the volume of a sphere

``````def cal_sphere_volume(radius:float)->float:
pi=3.14