Pig Latin is a fun way to communicate with your friends(kind of our secret language).
Let’s decode the pig latin using a simple algorithm, and convert them into sensible “english language”.
Concept of Pig Latin: just remove the first char from the word and put in the back with suffix “ay”.
Follow the steps:
# enter some pig latin string my_input = 'uckday ovemay illyway illynay' # step1: separate all words and create a list out of it, using space splitter input_list = my_input.split(' ') # creating list to collect the correct list of words correct_list =  print(input_list) for word in input_list: #step 2: using negative indexing for capturing last three chars last_3 = word[-3:] #step 3: re-constructing the word, prefixing first char from last_3 reword = (last_3[:1] + word) #step 4: trim last three letter(chars), resulting desired words refine = (reword[:len(reword)-3]) # adding correct words to the list correct_list.append(refine) print(correct_list)