[prog] quick question on Python

Guru - haunter03 at hotmail.com
Sun Dec 8 15:13:46 EST 2002


Regrading this function:
def euclid(a,b):
        while b:
        a,b = b,a % b
        print "Common factor is", a
        return a

With the return a....I'm confused on what exactly it does.
Becuase if I said print (after using the function) "This is the answer", a. 
a wouldn't be the variable that was found inside the function.
So what exactly does the return do, besides end the function?


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the Programming mailing list