Write a recursive function that takes as input parameters 3 numbers: The goal of
ID: 3543925 • Letter: W
Question
Write a recursive function that takes as input parameters 3 numbers: The goal of this function is to take the first number and count the numbers below it (to 0) that divide evenly into that number. It returns the count of the numbers that evenly divide into that number. So for instance, if the number is 12, the count should be 5. If the number is 6, the count should be 3, and if the number is 7, the count should be 1. My function returned a string printing out the original number and how many numbers divided evenly into it, but your number can return a number.
Explanation / Answer
def func(number) :
count=0
for i in range(number) :
if(i!=0 and number%i==0) :
count= count+1
return count
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.