<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Create a function which takes a set of numbers as argument and returns a dictionary containing the frequency of each number.
my_set = {1, 2, 2, 3, 4, 5, 6}<|im_end|>
<|im_start|>assistant
def freq_dict(my_set):
    # Initialize a empty dict
    frequency_dict = dict()
    # Iterate over given set
    for num in my_set:
        # Add or update item in the dict
        frequency_dict[num] = frequency_dict.get(num, 0) + 1
    return frequency_dict

# Example
my_set = {1, 2, 2, 3, 4, 5, 6}
print(freq_dict(my_set))
# Output: {1: 1, 2: 2, 3: 1, 4: 1, 5: 1, 6: 1}<|im_end|>
