write a program in python to convert the word in piglatin form
Answers
Answer:
Explanation:
Encoding a word into Pig Latin
Design a program to take a word as an input, and then encode it into a Pig Latin. A Pig Latin is an encrypted word in English, which is generated by doing following alterations:
The first vowel occurring in the input word is placed at the start of the new word along with the remaining alphabets of it. The alphabets present before the first vowel are shifted at the end of the new word followed by “ay”.
Examples:
Input: s = "paris"
Output: arispay
Input: s = "amazon"
Output: amazonay
Recommended: Please try your approach on {IDE} first, before moving on to the solution.
1) Find index of first vowel.
2) Create pig latin by appending following three.
.....a) Substring after starting with the first vowel
........till end.
.....b) Substring before first vowel.
.....c) "ay".