How to Use the Math Module to Calculate Exponential

import math

base = 2
exponent = 3
result = math.pow(base, exponent)
print(f"{base} raised to the power of {exponent} is {result}")

Output:

2 raised to the power of 3 is 8.0

Leave a Comment

Your email address will not be published.