Generation

generate functionMon, 26 Dec 2022

There is a list lst = ['BST161', 'BST162', 'BST163', 'BST161', 'BST161', 'BST164', 'BST162', 'BST161'] Write a function that counts the number of repetitions of the values in this list and displays them on the screen

def count_list(list): count_list = {} for i in list: if i in count_list: count_list[i] += 1 else: count_list[i] = 1 return count_list count_list(a)

Questions about programming?Chat with your personal AI assistant