<|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
Produce a program to print out the frequency of characters in a word.
Python<|im_end|>
<|im_start|>assistant
def character_frequency(word):
    freq_dict = {}
    for char in word:
        if char in freq_dict:
            freq_dict[char] += 1
        else:
            freq_dict[char] = 1
    return freq_dict

word = 'Python'
print(character_frequency(word))
# {'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}<|im_end|>
