fix identation

This commit is contained in:
Rohit Tanwar
2018-01-08 19:58:27 +05:30
parent 099b44fcd6
commit fd42cd7994

View File

@ -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):