请教!下面的代码为什么不能将摩尔斯电码转换为英语原文?
code=["._","_...","_._.","_..",".",".._.","__.","....","..",".___","_._","._..","__","_.","___",".__.","__._","._.","...","_",".._","..._",".__","_.._","_.__","__.."]message=input("请输入电报:")
message+=""
chars=""
output=""
for letter in message:
if letter!="":
chars=chars+letter
else:
for index in range(26):
if code[index]==chars:
output+=chr(ord('A')+index)
chars=""
print("英语原文是:",output)