培根密码解密脚本(Python)

#-*-coding:utf-8 -*-
b={'aaaaa':'A','aaaab':'B','aaaba':'C','aaabb':'D','aabaa':'E','aabab':'F','aabba':'G','aabbb':'H','abaaa':'I','abaab':'J','ababa':'K','ababb':'L','abbaa':'M','abbab':'N','abbba':'O','abbbb':'P','baaaa':'Q','baaab':'R','baaba':'S','baabb':'T','babaa':'U','babab':'V','babba':'W','babbb':'X','bbaaa':'Y','bbaab':'Z'}
e=raw_input('请输入密文:\n').lower()
a=''
for i in range(len(e)/5):
    a+=b[e[:5]]
    e=e[5:]
print a
print a.lower()