Given a number, and we have to write user defined functions to find the square and cube of the number is Python.
Example:
Input:
Enter an integer number: 6
Output:
Square of 6 is 36
Cube of 6 is 216
Function to get square:
def square (num):
return (num*num)
Function to get cube:
def cube (num):
return (num*num*num)
Program:
Output
Enter an integer number: 6 square of 6 is 36 Cube of 6 is 216need an explanation for this answer? contact us directly to get an explanation for this answer