Answer to Question #161088 in Python for Deekshita R

Question #161088

What is h(41)-h(40), given the definition of h below?

def h(n):
    s = 0
    for i in range(1,n+1):
        if n%i > 0:
           s = s+1
    return(s)
1
Expert's answer
2021-02-03T16:36:12-0500

Solution:

The output of  h(41) = 39

The output of  h(40) = 32


So, the output of  h(41)-h(40) = 39 - 32 = 7


Answer:

h(41)-h(40) = 7


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS