You could use already existing functions to achieve the same, here are my preferred ones:
from math import gcd
from functools import reduce
import numpy as np
lst = [14, 21, 28]
print(reduce(gcd, lst)) # prints "7"
print(np.gcd.reduce(lst)) # prints "7"