Question
Description Using The Provided Starter Notebook Found Here Pe11_starter.Ipynb And Write The Necessary Code To Create An English To Pig-Latin Translator. There Are Only Three
Description Using The Provided Starter Notebook Found Here Pe11_starter.Ipynb And Write The Necessary Code To Create An English To Pig-Latin Translator. There Are Only Three Rules To Translate English To Pig- Latin: ... If A Word Starts With A Consonant And A Vowel, Put The First Letter Of The Word At The End Of The Word And Add \"Ay.\" If A Word Starts
range(len (words)): words[i] = words[i]. lower() print(words) Enter english phrase: Are we there yet chew chew ['are', 'we', 'there', 'yet', 'chew', 'chew'] Step 2: Translate to Pig-Latin Using the three pig-latin rules, translate each word in words. [2]: vowels - \"aeiou\" consonants - \"bcdfghjklmnparstvwxyz\" # use a for Loop and the range function to Loop through all Indices of the list #insert an f/elif/else structure here that processes the three rules print(words) ['areway', 'eway', erethay', 'etyay', 'ewchay', ewchay'] Step 3: Create final string and display Words is currently in a list. Here we use the join string method to join all the words to create a string. 157 Pe phrase - .join(words) print(g_phrase) rewayway wayeway rethayeway ty
rrently in a list. Here we use the join string method to join all the words to create a string. 157 Pe phrase - .join(words) print(g_phrase) rewayway wayeway rethayeway tyayeway wchayeway wchayeway translates the words to Pig-Latin. 55]: #Step 1 Get the user input eng phrase=input( \"Enter the english phrases \") words-eng phrase.split() for i in range(len (words)): words[i]=words[i].lower print (words) vowel-[a, e, i, o, u] consonants -[b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z] ko #Step 2 Translate English to Pig-Latin for i in words: first-i[0] second=i[1] if(first in vowel): words[k]-i + \"way\" k=k+1 I elif((first not in vowel) and (second not in n1-len(i) words[k]=i[2:01] + i[0:2] + \"ay\" k-k+1 else(first not in vowel): nl-len(i) words[k]-1[1:n1] . i[@] + \"ay\" k=k+1 #Step 3: Create final string and display pg phrase-' 'join (words) print (P8_phrase) File \"\", line 22 ni-len(i) SyntaxError: invalid syntax
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started