Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
12 lines, easy and clean solution solution in Clear category for Split List by mickas
def split_list(items: list) -> list:
firstL = []
secondL = []
pivot = (len(items) // 2) + len(items) % 2
for i in range(pivot):
firstL.append(items[i])
for i in range (pivot, len(items)):
secondL.append(items[i])
return [firstL, secondL]
July 6, 2020