Translation (used to be 'Moving around in a string')

R

Ryan Spencer

Hello Again Everyone,

As previously aforementioned in my post 'Moving around in a string',
I've finally found my result to the pig_latin approach.

[start code]

import string

choice = raw_input("Would you like pig latin (p) or ubby dubby (u) translation? ")

sentence = raw_input("Please enter a sentence: ")

#Split up the sentence
words_within = sentence.split()

#Pig Latin
if choice == "p":

words_within = sentence.split(" ")
for word in words_within[0:]:
pig_latin = word[1:]+word[0]+"ay"
print pig_latin,

[end code]

Now all I have to find out how to do is find a vowel within the words of a
string and then do the ubbi dubbi thing (adding 'ub' after every spoken
vowel in a word it describes)

~Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top