2
我正在制作一个程序来接受一个句子,将每个单词转换成拉丁语,然后吐出来作为一个句子。我不知道我在哪里搞砸了。我输入一个句子,并运行它,它说Siimple Python。不知道为什么我的程序输出这个
内置的方法在0x03547D40
s = input("Input an English sentence: ")
s = s[:-1]
string = s.lower
vStr = ("a","e","i","o","u")
def findFirstVowel(word):
for index in range(len(word)):
if word[index] in vStr:
return index
return -1
def translateWord():
if(vowel == -1) or (vowel == 0):
end = (word + "ay")
else:
end = (word[vowel:] + word[:vowel]+ "ay")
def pigLatinTranslator(string):
for word in string:
vowel = findFirstVowel(word)
translateWord(vowel)
return
print (string)
欢迎SO!为了将来的参考,它通常会微笑地包含完整的回溯,主要是因为它包含错误的行号。另外,你甚至可能会发现你的错误,无需发布! – MANA624