Skip to content

Commit a45bad5

Browse files
Merge pull request seeditsolution#215 from iQaiserAbbas/patch-1
Define a split_in_two function that accepts a list and a number.
2 parents e7b27c7 + 444b681 commit a45bad5

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)