The code below is self-explanatory.
import math
def pyramid_AV(n, s, h):
""" Returns V, S for a right regular polygonal pyramid.
Returns the volume and total surface area of the right regular pyramid
of height h with a base of a regular n-gon of side s.
"""
a = s / 2 / math.tan(math.pi / n) # apothem
A = n * s * a / 2 # base area
l = math.hypot(h, a) # slant height
V = A * h / 3
S = A + n * s * l / 2
return V, S
print(pyramid_AV(5, 36.5, 12))
The volume and surface area are reported to be:
(9168.424067738604, 4832.337304213042)