Cody Bable

Generation

generate functionThu, 13 Apr 2023

divide a list into three separate list

def divide(lst): lst1 = lst[:len(lst)//3] lst2 = lst[len(lst)//3:2*len(lst)//3] lst3 = lst[2*len(lst)//3:] return lst1, lst2, lst3

Questions about programming?Chat with your personal AI assistant