7/19


#1

Could someone tell me the answer as I have been stuck for hours.

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

#2

Its Works

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

#3

Exercise 5.

Change the body of deserves_another so that it always adds 2 to the output of one_good_turn.

def deserves_another(n):
    return n + 2

You've already got the "adds 2" part there, so how can you get the output of one_good_turn? The is the thing you need to do.

To get a function to output something, you need to call it. And, in this case, you also have to send it something, because that is what it expecting.

Remember how to call a function? Use its name, and send it the value that it is expecting.

one_good_turn(n)

You just need to substitute that into your return statement in place of n.

Any questions, just ask.