diff --git a/area_polygon.py b/area_polygon.py new file mode 100644 index 00000000..b2171401 --- /dev/null +++ b/area_polygon.py @@ -0,0 +1,6 @@ +n=float(input("Enter no of sides in polygon:")) +r = float(input("Enter the radius of an inscribed circle: ")) +l=float(input("Length of one side of the polygon:")) +def area(r): + return ((n/2)*l*r) +print(f"Area: {area(r):.2f}") diff --git a/area_volume_cylinder.py b/area_volume_cylinder.py new file mode 100644 index 00000000..59cb5988 --- /dev/null +++ b/area_volume_cylinder.py @@ -0,0 +1,8 @@ +r=int(input("Enter the radius:")) +h=int(input("Enter the height:")) +def area(r,h): + return(2*3.14*r*h+2*3.14*r*r) +def vol(r,h): + return (3.14*r*r*h) +print(f"The Area:{area(r,h):.2f}") +print(f"The Volume:{vol(r,h):.2f}")