Skip to content

Commit 444b681

Browse files
authored
Define a split_in_two function that accepts a list and a number.
1 parent 229f8d6 commit 444b681

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

split.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def split_in_two(elements, num):
2+
if num%2 == 0:
3+
return elements[2:]
4+
else:
5+
return elements[:2]

0 commit comments

Comments
 (0)