Volume of cube using its space diagonal | Python 3 program to find the volume occupied by Cube with given space diagonal ; Function to calculate Volume ; Formula to find Volume ; Drivers code ; space diagonal of Cube
from math import sqrt , pow NEW_LINE def CubeVolume ( d ) : NEW_LINE INDENT Volume = ( sqrt ( 3 ) * pow ( d , 3 ) ) / 9 NEW_LINE return Volume NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT d = 5 NEW_LINE print ( " Volume ▁ of ▁ Cube : " , ' { 0 : . 6 } ' . format ( CubeVolume ( d ) ) ) NEW_LINE DEDENT