-1
我需要幫助,爲什麼這段代碼不起作用。錯誤在第13行。代碼中可能會有更多的錯誤,如果你發現一些只是告訴我如何解決它們。謝謝!豬拉丁語解碼器有錯誤
decode_PLoSM = raw_input("Enter pig latin for a Pig Latin decoder or enter "
"secret message for a secret message decoder")
if decode_PLoSM == "secret message":
check = raw_input("Is there an other?")
if check == "no":
where = raw_input("Enter the where")
new_where = where[:-2]
new_where_2 = new_where[-1] + new_where[:-1]
when = raw_input("Enter the when")
new_when = when[:-2]
new_when_2 = new_when[-1] + new_when[:-1]
print "Meet me in " + str(new_where_2) " at " + str(new_when_2)
elif check == "yes":
other_word = raw_input("Enter other")
where_2 = raw_input("Enter the where")
new_where_2 = where_2[:-2]
new_where_2_2 = new_where_2[-1] + new_where_2[:-1]
when_2 = raw_input("Enter the when")
new_when_2 = when_2[:-2]
new_when_2_2 = new_when_2[-1] + new_when_2[:-1]
other_word = raw_input("Enter the when")
other_word_2 = other_word_2[:-2]
other_word_2_2 = other_word_2[-1] + other_word_2[:-1]
print "Meet me in " new_where_2 + " at " + new_when_2
else:
print ""
elif decode_PLoSM == "pig latin":
pig_latin_word = raw_input("Enter the Pig Latin word")
new_PLW = pig_latin_word[:-2]
new_PLW_2 = new_PLW[-1] + new_PLW[:-1]
print new_PLW_2.lower()
else:
print "Please enter a word containing no numbers or symbols"
請複製並粘貼錯誤消息和隨之而來,所以人們不會被強迫運行代碼,試圖幫助你的任何回溯。 – holdenweb
什麼是完整錯誤?第13行是什麼? –