Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_1
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
ee199308
authored
Jun 07, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b5758fba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
sad.py
sd.py
store.py
sad.py
0 → 100644
View file @
ee199308
import
random
a
=
"python"
print
(
a
[
-
3
])
\ No newline at end of file
sd.py
0 → 100644
View file @
ee199308
# import random
# 私钥
key
=
"abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
# 要加密语句
message
=
"诺依,周末一起去看动漫展吧!"
# 加密后的语句(密文)
key_message
=
""
# 加密过程
for
i
in
message
:
str1
=
i
str2
=
random
.
choice
(
key
)
str3
=
random
.
choice
(
key
)
text
=
str1
+
str2
+
str3
key_message
=
key_message
+
text
print
(
key_message
)
store.py
View file @
ee199308
goods
=
{
'可口可乐'
:
3
,
'旺仔牛奶'
:
4
,
'农夫山泉'
:
1
,
'辣条'
:
3
,
'巴西烤肉'
:
2
,
'果冻'
:
4
,
'乐事'
:
5
,
'奥利奥'
:
10
,
'巧克力'
:
6
}
name
=
"刘强"
goods
.
pop
(
"农夫山泉"
)
power
=
66
print
(
good
)
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
# 请将"农夫山泉"删掉,并打印出新的商品信息
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
1
and
hero
[
i
]
>=
power
:
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
break
# 结束循环 continue 结束本次循环,进入下一次循环
print
(
hero
)
a
=
hero
[
-
6
:]
# 最强三人。切片
print
(
a
)
\ No newline at end of file
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