Functions Calling Functions, it says im right but it feels wrong


#1

what i have to do:
Change the body of deserves_another so that it always adds 2 to the output of one_good_turn.

what i did:
def one_good_turn(n):
return n + 1

def deserves_another(n):
return n + 3 <------ i just changed the 2 to a 3 and it said im right, but i dont think thats what i have to do (if it is right then i dont have a problem)


https://www.codecademy.com/courses/python-beginner-c7VZg/1/4?curriculum_id=4f89dab3d788890003000096#


no error messages

Replace this line with your code.


#2

@aerthur ,

Always format code when you post it. This enables users to see your indentation, underscores, and other important details.

To find out how to do it, see How do I format code in my posts?.

The instructions for the exercise state ...

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

However, you have this ...

return n + 3

... which always adds 3 to n.

Let's consider what needs to be changed ...

  • Instead of 3 in the expression, you need 2.
  • What do you need in the expression instead of n?

#3

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