def count_chars(str):
    char_count = {}

    for char in str:
        if char in char_count:
            char_count[char] += 1
        else:
            char_count[char] = 1

    return char_count

str = "Programming is fun"
result = count_chars(str)
print(result)