<p>我需要人帮我保留这些空间。我有凯撒密码功能,
但我想让它保留空间,却不知道该怎么做。在</p>
<pre><code>sentence = raw_input("Please enter a sentence : ").lower()
newString = ''
validLetters = "abcdefghijklmnopqrstuvwxyz"
space = [ ]
for char in sentence:
if char in validLetters or char in space:
newString += char
shift = input("Please enter your shift : ")
resulta = []
for ch in newString:
x = ord(ch)
x = x + shift
resulta.<a href="https://www.cnpython.com/list/append" class="inner-link">append</a>(chr(x if 97 <= x <= 122 else 96 + x % 122))
print sentence
print("")
print("Your encryption is :")
print("")
print ''.join(resulta)
</code></pre>
<p>它输出正确的代码,但删除空格。如何将空间加密?在</p>