We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2277ca9 commit b0e18acCopy full SHA for b0e18ac
BasicPythonScripts/Piglatin Translator/piglatintranslator.py
@@ -2,12 +2,15 @@
2
def englishtopiglatin(s):
3
# splits string by words and passed into list
4
s = s.lower().split(" ")
5
-
6
result = ""
7
8
# for every string in the list translate to pig latin through the formula before
9
for string in s:
10
- result += (string[1:] + string[:1] + "ay" + " ")
+
+ if (len(string) <= 1):
11
+ result += (string + "way")
12
+ else:
13
+ result += (string[1:] + string[:1] + "ay" + " ")
14
15
# return new string
16
return result
0 commit comments