Answer:
def pyramid_volume(base_length,base_width,pyramid_height):
return base_length * base_width * pyramid_height/3
length = float(input("Length: "))
width = float(input("Width: "))
height = float(input("Height: "))
print("{:.2f}".format(pyramid_volume(length,width,height)))
Explanation:
This line declares the function along with the three parameters
def pyramid_volume(base_length,base_width,pyramid_height):
This line returns the volume of the pyramid
return base_length * base_width * pyramid_height/3
The main starts here
The next three lines gets user inputs for length, width and height
<em>length = float(input("Length: "))</em>
<em>width = float(input("Width: "))</em>
<em>height = float(input("Height: "))</em>
This line returns the volume of the pyramid in 2 decimal places
print("{:.2f}".format(pyramid_volume(length,width,height)))