Cody Bable

Generation

generate functionThu, 13 Apr 2023

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

def separate_list(list): list_length = len(list) first_list_length = int(list_length/3) first_list = list[:first_list_length] second_list = list[first_list_length:first_list_length*2] third_list = list[first_list_length*2:] return first_list, second_list, third_list

Questions about programming?Chat with your personal AI assistant