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)
|   | 1 |  initial version  |  | 
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)
|   | 2 |  No.2 Revision  | 
 |   | 3 |  No.3 Revision  | 
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)
 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.
 
                
                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.