forked from sumedha3111/Python-for-Beginners
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolysum.py
More file actions
Latest commit
12 lines (12 loc) · 412 Bytes
/
Copy pathpolysum.py
File metadata and controls
12 lines (12 loc) · 412 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
importmath#Math module contains mathematical functions
defpolysum(n,s):
'''
Input: 'n' is the number of sides of a polygon with side length 's'
Returns the sum the area and square of the perimeter of the regular polygon rounded to 4 decimal places
'''
area=(0.25*n*s*s)/(math.tan(math.pi/n))
perimeter=n*s
res=area+(perimeter*perimeter)
res=round(res,4)
returnres
print(polysum(5,3))