| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.