human
Program for volume of Pyramid | Function to calculate Volume of Triangular Pyramid.
Function To calculate Volume of Square Pyramid.
Function To calculate Volume of Pentagonal Pyramid.
Function To calculate Volume of Hexagonal Pyramid.
Driver Code"
Solution in Python:
 Write me a code to program for volume of Pyramid and the other steps required?
assistant
#Here is code to program for volume of Pyramid and the other steps required.
 def volumeTriangular ( a , b , h ) :
	return ( 0.1666 ) * a * b * h
def volumeSquare ( b , h ) :
	return ( 0.33 ) * b * b * h
def volumePentagonal ( a , b , h ) :
	return ( 0.83 ) * a * b * h
def volumeHexagonal ( a , b , h ) :
	return a * b * h
b = float ( 4 )
h = float ( 9 )
a = float ( 4 )
print ( " Volume ▁ of ▁ triangular ▁ base ▁ pyramid ▁ is ▁ " , volumeTriangular ( a , b , h ) )
print ( " Volume ▁ of ▁ square ▁ base ▁ pyramid ▁ is ▁ " , volumeSquare ( b , h ) )
print ( " Volume ▁ of ▁ pentagonal ▁ base ▁ pyramid ▁ is ▁ " , volumePentagonal ( a , b , h ) )
print ( " Volume ▁ of ▁ Hexagonal ▁ base ▁ pyramid ▁ is ▁ " , volumeHexagonal ( a , b , h ) )