Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions area_polygon.py
Original file line number Diff line number Diff line change
@@ -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}")
8 changes: 8 additions & 0 deletions area_volume_cylinder.py
Original file line number Diff line number Diff line change
@@ -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}")