Commit c420bb2c by BellCodeEditor

auto save

parent 559fef77
Showing with 25 additions and 3 deletions
#导入模块
import random
message = "诺依,周末一起去看动漫展吧!" message = "诺依,周末一起去看动漫展吧!"
a="qerwehryuyoosAsia撒法iu啊sofa驸马发票发发我看了就微服务"
# 请使用索引的知识,取出message所有元素(不用遍历的方式) noise="pi@sfwesd"
\ No newline at end of file # 请使用索引的知识,取出message所有元素(不用遍历的方式)
text=""
for i in message:
str1=random.choice(a)
str2=random.choice(a)
text=text+i+str1+str2
#先把密文转化成列表
text1=list(text)
num=random.randint(0,len(text1))
#在进行插入
text1.insert(num,noise)
#输出
# print(text1)
#把列表转成字符串
str1="".join(text1)
print(str1)
# i=0
# while i<len(message):
# print(message[i])
# i+=1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment