我不知道该怎么做。我需要用不同的字母来加密一个字符串。在
def substitute(string, ciphertext):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
encrypted = []
list(alphabet)
list(ciphertext)
encrypted = ""
for x in string:
if x.isalpa():
encrypted.append(ciphertext[x])
else:
encrypted.append(x)
word = string.join(encrypted)
print(encrypted)
return encrypted
试试这个:
正如另一位评论者所说,在将来,请添加您的代码要做什么和不做什么的示例。在
我建议你查一下易变性的定义,因为这似乎是你正在努力解决的问题。在
相关问题 更多 >
编程相关推荐