Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use:

f (x,y)=x+y

a = 2; b = 3

f(a,b)

In this way you obtain 5, the desired result. Actually you don't need x and y, you could use only a and b, but I put different names just to underline the mechanism. The first line defines the function f with generic variables. The last line calculates the value of f when you actually pass the values of the variables. It can be a bit confusing at first, I hope my example can help.