Answers for "Given a list [1, 2, 3, 1, 2, 3, 4, 5, 5, 8, 1]. Write code in python to convert this list to a dictionary where the elements of the dictionary should be stored with their frequencies."

3

freq count in python

freq = {} 
    for item in my_list: 
        if (item in freq): 
            freq[item] += 1
        else: 
            freq[item] = 1
Posted by: Guest on July-21-2020

Code answers related to "Given a list [1, 2, 3, 1, 2, 3, 4, 5, 5, 8, 1]. Write code in python to convert this list to a dictionary where the elements of the dictionary should be stored with their frequencies."

Python Answers by Framework

Browse Popular Code Answers by Language