Python Program to Calculate Area of Square: All the edges in the Cube has same length. OR We can say, Cube is nothing but 6 equal squares.
If we know the length of any edge in Cube then we can calculate the surface area of a Cube using the formula:
Surface Area of a Cube = 6l² (Where l is the Length of any side of a Cube).
Area of a square = l² Since the Cube is made of 6 equal squares, Surface Area of a Cube = 6l²
If we already know the Surface Area of Cube and then we can calculate the length of any side by altering the above formula as:
l = √sa / 6 (sa = Surface Area of a Cube)
Calculate Area of Square in Python
Cube_Length = input("Enter Length of Cube :") Surface_Area = 6.0 * Cube_Length * Cube_Length Volume = pow(Cube_Length, 3) print "\n\nSurface Area of Cube is :" , Surface_Area print "Volume of Cube is :" , Volume
Enter Length of Cube : 10
Surface Area of Cube is : 600 .0
Volume of Cube is : 1000