语法错误和字符串单词在一起。打印命令

时间:2017-11-27 19:54:27

标签: python

 # Reading line of text
   text = input("Enter text: ")
   print("English: " ,text)

 # Removing punctuation
   text = removePunctuation(text)

 # Converting to lower case
   text = text.lower()


 # Iterating over words
  for word in text.split(" "):

 # Converting word to Pig Latin form
   word = pigLatin(word)

 # Printing word
   print(word, end = " ");

我怎样才能说出Pig:然后说猪拉丁形式?每次我尝试这个,它只是将Pig Latin变换添加到前一个单词。

1 个答案:

答案 0 :(得分:0)

print("Pig:", word)

下次,请使用大写字母和一些降价... https://stackoverflow.com/editing-help