Write a program that has a main() function and a multi value returning function named rspyramid(). The main() function prompts the user to provide two float values used to calculate both Area and Volume of a regular square pyramid, then calls rspyramid() with the user provided values. On the return the main() function should print the surface area and volume accurate to three decimal places. The function rspyramid() takes two values, base edge and height of the regular square pyramid, performs the necessary calculations and returns the two calculated values, surface area and volume. Code must match the example below Enter the base edge of a regular square pyramid: Enter the height regular square pyramid: The surface area is: The volume is:
In Python, Write a
The main() function prompts the user to provide two float values used to calculate both Area and Volume of a regular square pyramid, then calls rspyramid() with the user provided values.
On the return the main() function should print the surface area and volume accurate to three decimal places.
The function rspyramid() takes two values, base edge and height of the regular square pyramid, performs the necessary calculations and returns the two calculated values, surface area and volume.
Code must match the example below
Enter the base edge of a regular square pyramid:
Enter the height regular square pyramid:
The surface area is:
The volume is:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images