【发布时间】:2016-07-15 05:00:34
【问题描述】:
我正在编写一个程序来接收一个句子,将每个单词转换为拉丁语,然后将它作为一个句子吐出来。我不知道我在哪里搞砸了。我输入一个句子并运行它,它说
0x03547D40 处 str 对象下层的内置方法
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!为了将来参考,通常会笑着包含完整的回溯,主要是因为它包含错误的行号。此外,您甚至无需发布即可发现错误!
标签: python-3.x output