Python program to discover the intensity of a number utilizing exponential administrator

Python exponential administrator model: Here, we will figure out how to discover the intensity of a number utilizing exponential administrator utilizing exponential (**) administrator in Python?

Given two numbers a and b, we need to discover a to the power b utilizing exponential administrator (**).

Example:

    Input:
    a = 10
    b = 3

    # calculating power using exponential oprator (**)
    result = a**b
    print(result)

    Output:
    1000

Finding the power of Integer Value:

# python program to find the power of a number

a = 10
b = 3

# calculating power using exponential oprator (**)
result = a**b

print (a, " to the power of ", b, " is = ", result)

Output:

10  to the power of  3  is =  1000

Finding the power of Float Values:

# python program to find the power of a number

a = 10.23
b = 3.2

# calculating power using exponential oprator (**)
result = a**b

print (a, " to the power of ", b, " is = ", result)

Output:

10.23  to the power of  3.2  is =  1704.5197114724524

Leave a Comment

error: Alert: Content is protected!!