input: Write a function to count the number of words in a given string. The function should split the string by spaces and return the length of the resulting list which represents the number of words. If the input string is empty, the function should return 0.
  assert count_words('Hello world, this is a sentence.') == 5
  assert count_words('') == 0
output: def count_words(s):
      if s == '':
          return 0
      return len(s.split())