Skip to content

Commit 965d25a

Browse files
committed
Resolução do exercicio 12
1 parent ae9fd24 commit 965d25a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

exercicio-12/willidert/exercicio.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def split_arr(arr, n=4):
2+
div = len(arr)//n
3+
4+
result = []
5+
start = 0
6+
end = div
7+
while end <= len(arr):
8+
if len(arr) - end < div and len(arr) - end > 0:
9+
end += len(arr) - end
10+
11+
res = arr[start:end]
12+
start = end
13+
end += div
14+
result.append(res)
15+
return result
16+
17+
18+
arr = list(map(int, input().split()))
19+
20+
[print(i) for i in split_arr(arr, n)]

0 commit comments

Comments
 (0)