From the course: Transition from C# to Python

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution: Pig Latin

Solution: Pig Latin

From the course: Transition from C# to Python

Start my 1-month free trial

Solution: Pig Latin

(dramatic music) - [Narrator] All right, let's review the solution that I came up with for the Pig Latin challenge. So for this challenge, we took an input string from the user, and translated it into Pig Latin. So I'm going to open up my Python solution code, and here's my solution. So if we scroll all the way down, we can see that the input function, takes the place of the read line function and the console, so that's pretty easy. And then the topiglatin function is all lowercase, which is inline with Python coding standards. So this is what does the translation, and then we print the result. So let's scroll up. Here's my topiglatin solution, and I've got a few local variables like I did in the C Sharp version. So I have the vowels string to detect the presence of a vowel in the input string. The PL words holds the translated Pig Latin words, and the cur words variable, is a list of words that is created from…

Contents