Add two numbers

To carry on my normal process of notes on this website for different languages here is the how to add two numbers with a return value from a function.

To define a function you use the “def” syntax within the programming language and then the next bit of text before the parameters for the function itself ( in this case the parameters are the (number1, number2) ), is the function name and how to call the function.

The function below takes two parameters and returns back there result of the mathematical addition, the last part is how to call the function.

def addTwo(number1, number2) : 
	return number1 + number2
 
print addTwo(1,2)

and the output would be

3