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 of words. If the input string is empty, the function should return 0.
  assert word_counter('Hello world, this is a sentence.')==5
  assert word_counter('This is another example string.')==5
  assert word_counter('')==0
  assert word_counter('Single')==1
  assert word_counter('Two words')==2
output: def word_counter(s):
      if s == '':
          return 0
      return len(s.split())