In the Python program, we will learn how to calculate the Cube of a Number.
Here is the source code of the program to calculate the Cube of a Number.
# Python Program to Calculate Cube of a Number
#To take input from user
number = float(input("Enter any numeric Value: "))
cube = number * number * number
print("The Cube of a Given Number {0} = {1}".format(number, cube))
Enter any numeric Value: 5
The Cube of a Given Number 5.0 = 125.0
Python Program to Calculate Cube of a Number using Exponent Operator
# Python Program to Calculate Cube of a Number using Exponent Operator
#To take input from user
number = float(input("Enter any numeric Value: "))
cube = number ** 3
print("The Cube of a Given Number {0} = {1}".format(number, cube))
Enter any numeric Value: 3
The Cube of a Given Number 3.0 = 27.0
Comments