input: Write a function to convert a given string to Pig Latin.
  assert pig_latin("hello world") == "ellohay orldway"
  assert pig_latin("pig latin is fun") == "igpay atinlay isay unfay"
  assert pig_latin("apple") == "appleay"
output: def pig_latin(text):
      def convert_word(word):
          vowels = "aeiou"
          if word[0] in vowels:
              return word + "ay"
          else:
              return word[1:] + word[0] + "ay"
      
      return ' '.join(convert_word(word) for word in text.split())