python 新手,我正在尝试编码加密消息字母表改写如下:cipher = [ "q", "a", "z", "w", "s", "x", "e", "d", "c", "r", "f", "v", "t", "g", "b", "y", "h", "n", "u", "j", "m", "i", "k", "o", "l", "p"]idx = ord ("d") - ord ("a")print(cipher[3])输出:winput = str(input('Write Text: ')) #hello world used hereinput = input.lower()output = []for character in input: number = ord(character) - 97 output.append(number)print(output)输出:[7, 4, 11, 11, 14, -65, 22, 14, 17, 11, 3]不知道这两个怎么对应...我试过了:print(cipher[output])返回类型错误:列表索引必须是整数或切片,而不是列表
添加回答
举报
0/150
提交
取消