Answer to Question #157940 in Python for Prathi

Question #157940

Consider the following function mys:

def mys(m):
    if m == 1:
        return(1)
    else:
        return(m*mys(m-1))

Which of the following is correct?


The function always terminates with mys(n) = factorial of n

 

The function always terminates with mys(n) = 1+2+...+n

 

The function terminates for non-negative n with mys(n) = factorial of n

 

The function terminates for positive n with mys(n) = factorial of n


1
Expert's answer
2021-01-24T16:38:14-0500

The function terminates for positive n with mys(n) = factorial of n


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