educoder training - calculate the surface area and volume of geometric shapes

Level 1: Calculate the area of ​​a rectangle

mission details

Task for this level: Write a small program that can calculate the area of ​​a rectangle.

related information

The length, width, and height of a cuboid are X, Y, and Z, respectively.
Area of ​​rectangle: S=X∗Y
Surface area of ​​cuboid: S=2∗X∗Y+2∗X∗Z+2∗Y∗Z
Volume of cuboid: V=X∗Y∗Z

Problem Description

According to the corresponding formula to calculate the area of ​​the rectangle, the result is strictly reserved to 2 decimal places.

The template program gives the codes of the rectangle and cuboid, refer to these codes, and complete the calculation program of the area of ​​the rectangle.

Calculation of the surface area and volume of a cuboid, code example:

def cube(length, width, height):
    """计算长方体的表面积和体积"""
    # 下面两行分别计算表面积和体积
    area_of_cube 

Guess you like

Origin blog.csdn.net/qq_41234663/article/details/130009776