Python Online Compiler
Example: Python Program to Find Power of a Number using math.pow() function
C
C++
C#
Java
Python
PHP
main.py
STDIN
Run
# Python Program to Find Power of a Number using math.pow() function import math # math library loaded to call the math.pow() function b, x, r = None, None, 1 # b - To store base number # x - To store exponent number # r - To store result value print ("-----Enter the input of base number-----") b = float (input ()) print ("\n-----Enter the input of exponent number-----") x = float (input ()) r = math.pow(b, x) print ("\nThe calculation of the power of N number is ", b, "^", x, " = ", r)
12 4.6
Output
Clear
ADVERTISEMENTS