Write a Python code which will print out the number of words in a string.
Example string
def wordCount(str): 
    count = len(str.split()) 
    return count 

print(wordCount("Example string")) 

# Output: 2