Create a function in Python to create a wordcount of a given text.
"The lines of text that you're about to write will be filled with wonder and excitement"
def wordcount(text):
    counts = dict()
    words = text.split()

    for word in words:
        if word in counts:
            counts[word] += 1
        else:
            counts[word] = 1

    return counts

print(wordcount(text))