3. Python Program to find the Square and Cube of a given number.
How does this program work?
- In this program you will learn about how to do Mathematical functions using Python.
- This program will helpful to calculate square and cube of a number
- And then by using the given formula you will get output.
Here is the code
def square (num):
return num*num #Square of a number
def cube (num):
return num*num*num #Cube of a number
number = int(input("Enter an integer number: "))
print("Square of ",number," is ", square(number))
print("Cube of ",number," is ", cube(number))