In this python program, we will learn how to calculate the volume and surface area of a cube.

What is a Cube?

In geometry, a cube is a three-dimensional solid object bounded by six square faces, facets or sides, with three meetings at each vertex. The cube is the only regular hexahedron and is one of the five Platonic solids. It has 6 faces, 12 edges, and 8 vertices.

Formula

Surface Area of Cube = 6 * length * length

Volume of the Cube = length * length * length

Lateral Surface Area of Cube = 4 * (length * length)

Here is the Source code of the program to calculate the volume and surface area of a cube.

Python Program to Calculate the Volume and Surface Area of a Cube

# Python Program to Calculate the Volume and Surface Area of a Cube
# Take the Input from the User
length = float(input("Enter the Length of any Side of a Cube: "))
# Surface Area of the Cube
sa = 6 * (length * length)
# Volume of the Cube
Volume = length * length * length
# Lateral Surface Area of Cube
LSA = 4 * (length * length)
# Print the Output
print("\nSurface Area of Cube = %.2f" %sa)
print("Volume of cube = %.2f" %Volume)
print("Lateral Surface Area of Cube = %.2f" %LSA)

## Comments