P
P
PtrGrd2021-12-11 17:34:36
Python
PtrGrd, 2021-12-11 17:34:36

What is the correct way to slice such a list in Python?

The essence of the problem: I have a list with n-number of elements. I need to cut this list into groups, each of which will have its own data. I will give an example in code. It is necessary to make it so that in one list there are five different lists.

# Есть список с 10-ю элементами:
(input): data = ['123', '865', '124', '975', '245', '097', '127', '765', '532', '869']
# Нужно нарезать список data на 5 групп и добавить все в один список, чтобы получилось так:
(output): slice_data = 


Please tell me - how to do it right? Thanks a lot!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question