I am playing around with python3 in idle and after discovering what Pig Latin is I am trying to write a couple functions and am confused about where to start/what python specific words/functions I should be using.
(i) 1 parameter -I am trying to translate words from pig latin back to English. It would always end with "ay" and only have one hyphen. Essentially I am trying to remove the hypen and "ay" at the end of the pig latin word. I believe I need to start by finding the position of the hyphen. Then I want it to extract from the string 2 substrings: the portion before the hyphen and the portion between the hyphen and the "ay" at the end. For example, when given the string "at-thay", the two substrings are "at" and "th". Following this I want to combine the two substrings to create the English word. (example above would return "that")
(ii) I want a function that takes a single parameter, a string, and finds the first position within that string where any of the characters "aeiouAEIOU" appears. For example, given the string "is", your function should return 0, and given the string "Pig", I want the function to return 1. If the string doesn't have any of the listed vowels in it at all, such as with the string "shh", then the function should return the length of the string, which would be 3 in this example.
(iii) I want a function that returns the translation of a single word from English to Pig Latin. The translation consists of everything from the first vowel onward then a hyphen, the portion of the word that preceded the first vowel, and the letters "ay".
I know this is a tall order but any help with any of these 3 would greatly help!