Cody Bable

Generation

generate functionThu, 13 Apr 2023

divide this ['a', 'b', 'c', '1', '2', '3','4', '5', '6'] evenly into three separate list

l = ['a', 'b', 'c', '1', '2', '3','4', '5', '6'] def split(l, num_of_groups): return [l[i::num_of_groups] for i in range(num_of_groups)] split(l,3)

Questions about programming?Chat with your personal AI assistant