How should I add x and y together?


#1

Question

How should I add x and y together?

Answer

In this exercise we need to return the addition of our two parameters, x and y. We can do math in a return statement like this:

def my_function(value_1, value_2):
  return value_1 + value_2

FAQ: Learn Python - Lists and Functions - More than one argument