subject
Arts, 29.02.2020 06:21 blondie02

"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. A. Does the submission include the is_divisible function from Section 6.4 of the textbook? B. Does the submission implement an is_power function that takes two arguments? C. Does the is_power function call is_divisible? Does the is_power function call itself recursively? D. Does the is_power function include code for the base case of the two arguments being equal? E. Does the is_power function include code for the base case of the second argument being "1"? F. Does the submission include correct output for the five test cases"

ansver
Answers: 1

Other questions on the subject: Arts

image
Arts, 21.06.2019 15:00, tomasgarrido10
Can anyone give me a website (without the link just the name or a screenshot of the site) to a tutorial for music production like fl studio where i can learn for free? cause i'm trying to become a solo artist but i don't know how to use the software yet.
Answers: 1
image
Arts, 22.06.2019 01:30, damilysgonzalez2
What was the role of the orchestra in an opera?
Answers: 3
image
Arts, 22.06.2019 18:20, haileyw123
Awork in three dimensions which has height, breadth and depth.
Answers: 2
image
Arts, 23.06.2019 12:00, bowmanari2154
Alex thinking about repleacing the word feared at the end of paraghaph 2 with dreaded. why do you think he want to make that change? dreaded has a neutral connotation, feared has a neutral connotation, dreaded has a stronger negative connotation, feared has a more negative connotation.
Answers: 2
You know the right answer?
"Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4....

Questions in other subjects:

Konu
Geography, 21.01.2020 20:31
Konu
Social Studies, 21.01.2020 20:31