我创建了一个小猪拉丁语翻译器。我运行这个程序,它会打开,我输入一个单词,然后只要我按下' enter‘,程序就会关闭。为什么会这样呢?userWord = input('Enter any word:')
word= userWord.lower() new = word[1:] + first + pig
我是Python的新手,正在尝试制作一个Pig拉丁语翻译器。我的情况是,你使用的“猪拉丁语”的“类型”取决于一个元音和/或辅音在这个词的恳求处的位置。Welcome to the Pig Latin translator!:)"# Welcome MSG
eng = raw_input("Please enter in a word in English to translate to Pig Latin.")
我正在尝试做一个小猪拉丁语翻译器,但是如果你输入的单词超过两个,.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.pop(a)
pig<