Cody Bable

Generation

generate functionThu, 13 Apr 2023

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

def divide_list(list): list1 = [] list2 = [] list3 = [] for i in list: if i.isalpha(): list1.append(i) if i.isnumeric(): list2.append(i) if i.isalnum(): list3.append(i) return list1, list2, list3 divide_list(['a', 'b', 'c', '1', '2', '3'])

Questions about programming?Chat with your personal AI assistant