From a22d31c1a0c7cf73972796f47a67260996d3b349 Mon Sep 17 00:00:00 2001 From: Shubhayan Saha Date: Tue, 11 Oct 2022 17:08:17 -0400 Subject: [PATCH] added translator.py --- Python/translator.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Python/translator.py diff --git a/Python/translator.py b/Python/translator.py new file mode 100644 index 00000000..4f60ba7f --- /dev/null +++ b/Python/translator.py @@ -0,0 +1,16 @@ +# latin_translator.py + +#request user for input +user_input = input("Input text to translate to pig latin: ") +print("User Text: ", user_input) + +# This step breaks the words into a list +updated_user_input = user_input.split(' ') + +for j in updated_user_input: + if len(j) >= 3: #only translate words with more than 3 characters + j = j + "%say" % (j[0]) + j = j[1:] + print(j) + else: + pass \ No newline at end of file