diff --git a/snippets/gcd.md b/snippets/gcd.md index bbdd0f462..736b068ac 100644 --- a/snippets/gcd.md +++ b/snippets/gcd.md @@ -32,8 +32,6 @@ def gcd(*args): ``` - - ``` python -gcd(8,36); # 4 +gcd(8,36) # 4 ``` \ No newline at end of file diff --git a/snippets/lcm.md b/snippets/lcm.md index b269a7427..3b0b0490f 100644 --- a/snippets/lcm.md +++ b/snippets/lcm.md @@ -33,8 +33,7 @@ def lcm(*args): ``` - ``` python -lcm(12, 7); # 84 -lcm([1, 3, 4], 5); # 60 +lcm(12, 7) # 84 +lcm([1, 3, 4], 5) # 60 ``` \ No newline at end of file diff --git a/snippets/spread.md b/snippets/spread.md new file mode 100644 index 000000000..e51da4f1e --- /dev/null +++ b/snippets/spread.md @@ -0,0 +1,20 @@ +### spread + +Implements javascript's spread syntax as a function. Flattens the list(non-deep) and returns an array. + +```python +def spread(arg): + ret = [] + for i in arg: + if isinstance(i, list): + ret.extend(i) + else: + ret.append(i) + return ret + +``` + + +```python +spread([1,2,3,[4,5,6],[7],8,9]) # [1,2,3,4,5,6,7,8,9] +``` \ No newline at end of file diff --git a/stopwatch.png b/stopwatch.png deleted file mode 100644 index b84672d14..000000000 Binary files a/stopwatch.png and /dev/null differ