返回 DeepSeek-Reasonix
utils.py
1 def head(lst, n):
2 return lst[:n]
3
4
5 def tail(lst, n):
6 if n <= 0:
7 return []
8 return lst[-n:-1]
9
10
11 def chunk(lst, size):
12 return [lst[i : i + size] for i in range(0, len(lst), size)]
13
13 lines PYTHON