# How to make a function return a value

I'm writing a Sage Function for the Euclid's Algorithm. However when I run it, it doesn't compute any values. Please let me know what is wrong or anyway to help.

```
def euclide(a,b):
r=a%b
print (a,b,r)
while r !=0:
a=b; b=r
r=a%b
print (a,b,r)
sage: euclide(12,5)
(12, 5, 2)
(5, 2, 1)
(2, 1, 0)
```

I shortened the title of your question, and put the longer version as the text of your question, together with the code. By the way the answer is given by @kcrisman (I changed it from a comment to an answer).