Write a Python Program to Calculate Cube of a Number

This tutorial will discuss Write a Python Program to Calculate Cube of a Number in this tutorial. In this python program, we will learn the Calculate Cube of a Number concept in the python language.

Write a Python Program to Calculate Cube of a Number

Calculate the Cube of a Number in the Python Program

In this python program, we discuss Python Program to Calculate Cube of a Number.

number = float(input(" Please Enter any numeric Value : "))
cube = number * number * number
print("The Cube of a Given Number {0}  = {1}".format(number, cube))

Here, Below is The Output of this Program.

Please Enter any numeric Value : 4
The Cube of a Given Number 4.0  = 64.0

To find the Cube of a Number using Functions In Python Program

In this python program, we discuss Python Program to Calculate the Cube of a Number using a function.

 

def cube(num):
    return num * num * num

number = float(input(" Please Enter any numeric Value : "))

cub = cube(number)

print("The Cube of a Given Number {0}  = {1}".format(number, cub))

Here is the OutPut Of Find Cude Number in python program using function.

Please Enter any numeric Value : 8
The Cube of a Given Number 8.0  = 512.0

Leave a Comment

Verified by MonsterInsights