Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_4
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a5984ce2
authored
Feb 12, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a2228c7a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
1.py
diy4.py
1.py
View file @
a5984ce2
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
diy4.py
View file @
a5984ce2
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment