我正在使用Python3.4.1。任何帮助将不胜感激
text = (str(input('Enter your message here, in upper case')))
key = (str(input('Enter the key word here, in upper case')))
for a in range (0,len(text),1):
code = ord((text[a])+(ord(key[a%len(key)]))-64)
if (text[a]==' '):
print(' ', end= '')
elif code > 90:
print(chr(code + 26), end = '')
else:
print(chr(code), end = '')