Finding the greatest common factor using Euclid's algorithm in Python