└── volume /volume: -------------------------------------------------------------------------------- 1 | def volume_unit_cubes(length, width, height): 2 | return length * width * height 3 | 4 | # Example usage: 5 | volume = volume_unit_cubes(5, 3, 2) 6 | print("The volume is:", volume) 7 | 8 | # Define the value of pi 9 | pi = 3.1415926535897931 10 | 11 | # Define the radius of the sphere 12 | r = 6.0 13 | 14 | # Calculate the volume of the sphere 15 | volume = (4/3) * pi * (r ** 3) 16 | 17 | # Print the result 18 | print("The volume of the sphere is:", volume) 19 | 20 | # Define the value of pi 21 | pi = 3.1415926535897931 22 | 23 | # Define the radius and height of the cylinder 24 | radius = 4.0 25 | height = 10.0 26 | 27 | # Calculate the volume of the cylinder 28 | volume = pi * (radius ** 2) * height 29 | 30 | # Print the result 31 | print("The volume of the cylinder is:", volume) 32 | 33 | # Define the base and height of the parallelogram 34 | base = 6.0 35 | height = 8.0 36 | 37 | # Calculate the area of the parallelogram 38 | area = base * height 39 | 40 | # Calculate the volume of the parallelogram 41 | volume = area * 10.0 # Assuming the parallelogram has a height of 10 units 42 | 43 | # Print the result 44 | print("The volume of the parallelogram is:", volume) 45 | --------------------------------------------------------------------------------