def count_words(string):

words = string.split()
word_count = {}
for word in words:
    if word in word_count:
        word_count[word] += 1
    else:
        word_count[word] = 1
return word_count

string = "I love programming. Programming is fun!" print(count_words(string))