Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_7
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
79e4f6d8
authored
Jan 09, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
18891748
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
aaa.py
diy4.py
aaa.py
0 → 100644
View file @
79e4f6d8
# text="hello world!"
# for i in text:
# print(i)
# str1="bellcode"
# print(str1[4:])
# text=['p','y','t','h','o','n']
# print("/".join(text))
# str1='本节课我们学习文字加密'
# str2='用python进行'
# list1=list(str1)
# list1.insert(7,str2)
# print("".join(list1))
# print("".join(list(str1).insert(7,str2)))
a
=
0
b
=
0
c
=
0
import
random
for
i
in
range
(
3000
):
x
=
random
.
randint
(
8
,
10
)
if
x
==
8
:
a
+=
1
elif
x
==
9
:
b
+=
1
else
:
c
+=
1
print
(
a
,
b
,
c
)
\ No newline at end of file
diy4.py
0 → 100644
View file @
79e4f6d8
import
random
# 私钥
key
=
"abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message
=
input
(
"请输入密文:"
)
list1
=
list
(
message
)
num
=
random
.
randint
(
0
,
len
(
list1
))
list1
.
insert
(
num
,
"port@#$
%
^&"
)
# str5="".join(list1)
# print(str5)
print
(
""
.
join
(
list1
))
# 请使用私钥key,对message进行加密
# for i in message:
# s1=i
# s2=random.choice(key)
# s3=random.choice(key)
# text=s1+s2+s3
# 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