-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lecture "Recursion", exercise 1 #26
Comments
def exponentation(base_number, exponent): |
The output is:
|
|
|
|
|
It returns:
|
|
|
|
This function can return a proper result for negative integer exponents and also proper error message return, for non-integer exponents and also a special case of zero power zero and zero power negative exponent. This function rounds the result of a negative integer exponent with 4 digits.
|
|
input
output |
|
|
Output
|
Hi all, just a couple of notes:
|
|
Define a recursive function
def exponentiation(base_number, exponent)
for implementing the exponentiation operation. Test (by implementing the related test case) it on the following inputs: 34, 171, and 20.The text was updated successfully, but these errors were encountered: