bug fix in gcd.md

There is a function-redefined bug in origin code. This PR uses an alias to fix the bug.
This commit is contained in:
zhangfelix
2020-06-19 18:29:21 +08:00
committed by GitHub
parent 42614dd588
commit 1069939543

View File

@ -9,10 +9,10 @@ Use `functools.reduce()` and `math.gcd()` over the given list.
```py
from functools import reduce
from math import gcd
from math import gcd as gcd_from_math
def gcd(numbers):
return reduce(gcd, numbers)
return reduce(gcd_from_math, numbers)
```
```py