Python Practice › Basic Programs › Program 17
Surface area of a cube
Write a Python program to calculate the surface area of a cube. Surface area = 6 × a².
Input
a = 4
Output
Surface area of the cube: 96
Approach
- A cube has 6 square faces, each of area a².
Solution
a = 4surface_area = 6 * a ** 2print("Surface area of the cube:", surface_area)Output
Surface area of the cube: 96
Line by line
Line 2
Six faces times the area of one face, a ** 2.
Learn the concept
New to this topic? Read the lesson, then come back.