Created
October 31, 2022 13:00
-
-
Save CodeByAidan/100056e11370fcd3ec4c05a42456588f to your computer and use it in GitHub Desktop.
Power Function Calculator - super simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
# Take the base value from the user | |
x = int(input("Enter the base value: ")) | |
# Take the power value from the user | |
n = int(input("Enter the power value: ")) | |
# Print the result | |
print("%d to the power %d = %f" % (x, n, pow(x, n))) | |
# Print the remainder value | |
print("The remainder value = ", pow(x, n, 5)) | |
except: | |
# Print the error message | |
print("Error exists in the script.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment