79451968

Date: 2025-02-19 15:52:18
Score: 1
Natty:
Report link

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"
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Thomas Rasser