Please provide a python code snippet that counts the number of words in a given sentence.
my_string = "This is a sentence with five words."
my_string = "This is a sentence with five words."
words = my_string.split(" ")
print(len(words))