input: Write a python function to generate a sentence with a limit on the number of words.
  assert generateSentence(3) == 'Hello World He '
  assert generateSentence(5) == 'Hello World He She They '
  assert generateSentence() == 'Hello World He She They Good Bad '
output: def generateSentence(limit=None):
      words = ['Hello', 'World', 'He', 'She', 'They', 'Good', 'Bad']
      if limit is None:
          return ' '.join(words) + ' '
      return ' '.join(words[:limit]) + ' '