

Piglatin translator how to#
I would really appreciate it if anybody could give suggestions of how to improve the code and make the program more efficient. Note that hyphenated words are treated as two words. Over the last few days I created this Pig Latin Translator just for fun. This is accomplished via this HTML document and accompanying JavaScript program.

Speaking of lang, it doesn't look like you need it. English to Pig Latin Translator Enter English Text to Translate: Enter the English text here that you want translated into Pig Latin. You may also want to change the name of the function because it doesn't convey much meaning when calling it like that. Pass # or time.sleep(1) like you did, but it feels a bit unresponsive This let you handle retries outside of the function: while not main(): Translated_sentence = ' '.join(translate(word) for word in sentence.split()) Print("Invalid input, please do not use numbers or punctuation marks") Question = "Enter a sentence to translate it into : ".format(lang)) To_piglatin = ("e", "p").index(to_piglatin.lower()) To_piglatin = input("Do you want to translate something to piglatin, or to english: ") I would just like it if someone reviewed my code and see if anything can be done to make it more Pythonic or efficient. I am a relatively new Python programmer and made a simple Pig Latin to English translator and vice versa.
