The Highest Common Factor (HCF), also called gcd, can be computed in python using a single function offered by math module and hence can make tasks easier in many situations.
GCD in Python : https://www.geeksforgeeks.org/gcd-in-python/