fix identation
This commit is contained in:
@ -7,8 +7,8 @@ The `helperGcdfunction` uses recursion. Base case is when `y` equals `0`. In thi
|
|||||||
Uses the reduce function from the inbuild module `functools`. Also defines a method `spread` for javascript like spreading of arrays.
|
Uses the reduce function from the inbuild module `functools`. Also defines a method `spread` for javascript like spreading of arrays.
|
||||||
|
|
||||||
``` python
|
``` python
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
def spread(arg):
|
def spread(arg):
|
||||||
ret = []
|
ret = []
|
||||||
for i in arg:
|
for i in arg:
|
||||||
if isinstance(i,list):
|
if isinstance(i,list):
|
||||||
@ -16,7 +16,7 @@ Uses the reduce function from the inbuild module `functools`. Also defines a met
|
|||||||
else:
|
else:
|
||||||
ret.append(i)
|
ret.append(i)
|
||||||
return ret
|
return ret
|
||||||
def gcd(*args):
|
def gcd(*args):
|
||||||
numbers = []
|
numbers = []
|
||||||
numbers.extend(spread(list(args)))
|
numbers.extend(spread(list(args)))
|
||||||
def helperGcd(x,y):
|
def helperGcd(x,y):
|
||||||
|
|||||||
Reference in New Issue
Block a user