0 out of 464 challenges solved
Write a Python function `freq_count` that takes a list of elements as input and returns a dictionary where the keys are the unique elements from the list, and the values are the counts of how many times each element appears in the list. #### Example Usage ```python [main.nopy] print(freq_count([10, 10, 20, 20, 20, 30])) # Output: {10: 2, 20: 3, 30: 1} print(freq_count(['a', 'b', 'a', 'c', 'b', 'a'])) # Output: {'a': 3, 'b': 2, 'c': 1} ``` #### Constraints - The input list can contain any hashable elements (e.g., integers, strings, tuples). - The function should handle an empty list and return an empty dictionary in that case.
from typing import List, Dict def freq_count(elements: List) -> Dict: """ Calculate the frequency of each element in the input list. Args: elements (List): A list of hashable elements. Returns: Dict: A dictionary with elements as keys and their frequencies as values. """ # Placeholder for the solution pass