我需要帮助解释为什么这段代码无法正常工作。错误在第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"
答案 0 :(得分:0)
添加+以连接字符串:
print "Meet me in + new_where_2 + at + new_where_2"