Power Calculator

Write a Python function that calculates and returns the value of a number raised to a power. The function should accept two arguments: the base and the exponent. The function should accept two arguments: the base and the exponent.

Example 1:

Input: 2, 3 
Output: 8

Example 2:

Input: 5, 4 
Output: 625

Use the ** operator to calculate the power of a number.

def power_calculator(base, exponent):
    return base ** exponent

© Let’s Data Science

LOGIN

Unlock AI & Data Science treasures. Log in!