Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Python/translator.py
Original file line number Diff line number Diff line change
@@ -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