recursion

Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4.  Your program may assume that both arguments to is_power are positive integers. Note that the only positive integer that is a power of “1” is “1” itself.

After writing your is_power function, include the following test cases in your script to exercise the function and print the results:

print(“is_power(10, 2) returns: “, is_power(10, 2))print(“is_power(27, 3) returns: “, is_power(27, 3))print(“is_power(1, 1) returns: “, is_power(1, 1))print(“is_power(10, 1) returns: “, is_power(10, 1))print(“is_power(3, 3) returns: “, is_power(3, 3))

You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code.

Your submission will be assessed using the following Aspects.

  1. Does the submission include the is_divisible function from Section 6.4 of the textbook?
  2. Does the submission implement an is_power function that takes two arguments?
  3. Does the is_power function call is_divisible?
  4. Does the is_power function call itself recursively?
  5. Does the is_power function include code for the base case of the two arguments being equal?
  6. Does the is_power function include code for the base case of the second argument being “1”?
  7. Does the submission include correct output for the five test cases?

Hide 

Calculate the price of your order

Simple Order Process

Fill in the Order Form

Share all the assignment information. Including the instructions, provided reading materials, grading rubric, number of pages, the required formatting, deadline, and your academic level. Provide any information and announcements shared by the professor. Choose your preferred writer if you have one.

Get Your Order Assigned

Once we receive your order form, we will select the best writer from our pool of experts to fit your assignment.

Share More Data if Needed

You will receive a confirmation email when a writer has been assigned your task. The writer may contact you if they need any additional information or clarifications regarding your task

Let Our Essay Writer Do Their Job

Once you entrust us with your academic task, our skilled writers embark on creating your paper entirely from the ground up. Through rigorous research and unwavering commitment to your guidelines, our experts meticulously craft every aspect of your paper. Our process ensures that your essay is not only original but also aligned with your specific requirements, making certain that the final piece surpasses your expectations.

Quality Checks and Proofreading

Upon the completion of your paper, it undergoes a meticulous review by our dedicated Quality and Proofreading department. This crucial step ensures not only the originality of the content but also its alignment with the highest academic standards. Our seasoned experts conduct thorough checks, meticulously examining every facet of your paper, including grammar, structure, coherence, and proper citation. This comprehensive review process guarantees that the final product you receive not only meets our stringent quality benchmarks but also reflects your dedication to academic excellence.

Review and Download the Final Draft

If you find that any part of the paper does not meet the initial instructions, send it back to us with your feedback, and we will make the necessary adjustments.