diy4.py 360 Bytes Edit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import random key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!" message = "诺依,周末一起去看动漫展吧!" s="" for i in message: a=i b=random.choice(key) c=random.choice(key) d=a+b+c s=s+d p=list(s) a='fgjjhjghvm' r=random.randint(0,len(p)) p.insert(r,a) z="".join(p) print(z)