我正在尝试做一个小猪拉丁语翻译器,但是如果你输入的单词超过两个,.pop函数就会变得疯狂,我不知道为什么。信息和修复将是有帮助的。谢谢。x = input("Type phrase or word you would like to be translated to pig latin:")y = x.split()n = len(y) -1 first_word = y.p
import string filename = input("Enter the name of a file to translate into Pig Latinending) print(" ".join(pigList))
main() 我相信这已经修复了我的错误谢谢你的帮助。我知道让翻译器正确地工作,一次翻译所有的行,而不是一次翻译一行。
在Codeacademy上学习python。这是一个简单的小猪拉丁语翻译器程序。正如标题所说,根据先前的输入(故意输入不正确),函数返回不同的(第一个)值,而不是if else清除的最新值。valid word" else: return name
print 'Welcome to the PigEnter a valid wor
我一直在为大学的一个小组项目创建一个Pig拉丁语翻译器(我们实际上不需要制作翻译器,只需以任何我们喜欢的方式操作字符串,我选择了这个)。我的翻译器输入的是一个拉丁文祈祷词,它的前两行是:patrem omnipotentem public static voidFileNotFoundException