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)

Expert's answer

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


LATEST TUTORIALS
APPROVED BY CLIENTS