input: Write a function to convert a sentence to Pig Latin.
  assert toPigLatin('hello world') == 'ellohay orldway'
  assert toPigLatin('python is fun') == 'ythonpay isway unfay'
  assert toPigLatin('i am learning') == 'iway amway earninglay'
output: def toPigLatin(sentence):
      def convert_word(word):
          if word[0] in 'aeiou':
              return word + 'way'
          else:
              return word[1:] + word[0] + 'ay'
      
      return ' '.join(convert_word(word) for word in sentence.split())