Functions Calling Functions or 5/19


#1

Ok so the problem is… My train of thought says that if you need to keep adding the same no. to a def then the following code should result into the desired “Output” And according to my Interpreter it gives no errors.

I am only asking as it seems to give the impression that a clearer explanation is needed or YOU TUBE here I come…

A:

def one_good_turn(n):
  return n + 1
    
def deserves_another(n):
  return n ++ 2

But it didn’t quit sit well with me after a couple of min. So I looked at other posts. And it is getting confusing as there seems to be multiple other “correct ways” Which I tested myself and seemed to also be correct.

def one_good_turn(n):
  return n + 1
    
def deserves_another(n):
  return one_good_turn(n) + 2

C:

def one_good_turn(n):
  return n + 1
    
def deserves_another(n):
  return one_good_turn(n) ++ 2

#2

What are you asking?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.