Create a Python script that takes a given text string and outputs the number of words in the string.
Text string: “I love programming”
def wordCount(text):
    words = text.split(' ')

    return len(words)

print(wordCount("I love programming"))  # 3