From the course: Transition from C# to Python

Unlock the full course today

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

Challenge: Pig Latin

Challenge: Pig Latin

From the course: Transition from C# to Python

Start my 1-month free trial

Challenge: Pig Latin

(dramatic music) - [Narrator] All right, time for another programming challenge. So for this programming challenge, we're going to tackle a common programming exercise involving strings. It's called the Pig Latin translator. So Pig Latin of course, is a silly kids game where you take a word, and you transform it, so that it ends with the starting consonant, And along with the vowels, a and y. And I have a C Sharp version of this exercise already completed. So let's go into the challenge folder and challenge CS. So, you can see that the C Sharp code, reads a string from the command line, and then calls a function called ToPigLatin, which then transforms the words into a sentence of Pig Latin words, and then prints out the result. And if we look at the code, we can see that it's a pretty simple algorithm. We split the string into words, and then we find the position of the first vowel. And then we split off the…

Contents