Cody Bable

Generation

generate functionThu, 13 Apr 2023

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

def divide(lst, n): return [lst[i::n] for i in range(n)] divide(['a', 'b', 'c', '1', '2', '3'], 3)

Want to kickstart your project?Use the new AI Studio to create your code