Commit a5984ce2 by BellCodeEditor

auto save

parent a2228c7a
Showing with 35 additions and 4 deletions
for i in range(len(a)): # str ="学习力,思考力,行动力,创造力"
if a[i] in list # print(str[4:7])
\ No newline at end of file
# a="种瓜得瓜"
# # print(a.find("瓜")) #寻找值的第一个索引
# for i in range(len(a)):
# if a[i] == "瓜":
# print(i)
# break
# print("我学习Scratch"+str(a)+"年了,学习Python"+str(b)+"年了")
# print("我学习Scratch{1}年了,学习Python {0}年了".format('a','b'))
# scores =[95,67,79,88,65,99]
# # scores.sort(reverse = False)
# # print(scores)
# for i in range(1,len(scores)):
# for j in range(0,len(scores)-i):
# if scores[j]>scores[j+1]:
# k=scores[j]
# scores[j]=scores[j+1]
# scores[j+1]=k
# print(scores)
import random
random.randint(1,10) # 生成1到10的随机数
\ No newline at end of file
...@@ -3,7 +3,7 @@ import random ...@@ -3,7 +3,7 @@ import random
# 私钥 # 私钥
key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!" key = "abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句 # 要加密语句
message = "诺依,周末一起去看动漫展吧!" message = input('请输入需要加密的语句:')
text="" text=""
# 请使用私钥key,对message进行加密 # 请使用私钥key,对message进行加密
...@@ -12,4 +12,8 @@ for i in message: ...@@ -12,4 +12,8 @@ for i in message:
str2=random.choice(key) str2=random.choice(key)
str3=random.choice(key) str3=random.choice(key)
text=text+str1+str2+str3 text=text+str1+str2+str3
a="#$%^&*(())"
text=list(text)
text.insert(random.randint(0,len(text)),a)
text="".join(text)
print(text) print(text)
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