Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Created October 10, 2022 11:59
Show Gist options
  • Select an option

  • Save RaMSFT/ae2fc65be6e2dd9adb90559ec4656fa1 to your computer and use it in GitHub Desktop.

Select an option

Save RaMSFT/ae2fc65be6e2dd9adb90559ec4656fa1 to your computer and use it in GitHub Desktop.
def calculate_power(x, n):
"""calculate the power
Args:
x (integer): integr value
n (integer): integer value
Returns:
_type_: power of x to the n
"""
power = x ** n
return power
print(calculate_power(10, 5))
print(calculate_power(5, 5))
print(calculate_power(2, 50))
print(calculate_power(3, 9))
print(calculate_power(9, 5))
print(calculate_power(1, 1000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment