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
a2fd9188
authored
Oct 22, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
135cba08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
20 deletions
diy4.py
三.py
diy4.py
View file @
a2fd9188
import
random
goods
=
{
'可口可乐'
:
3
,
'旺仔牛奶'
:
4
,
'农夫山泉'
:
1
,
'辣条'
:
3
,
'巴西烤肉'
:
2
,
'果冻'
:
4
,
'乐事'
:
5
,
'奥利奥'
:
10
,
'巧克力'
:
6
}
# 请将"农夫山泉"删掉,并打印出新的商品信息
# 私钥
goods
.
pop
(
"农夫山泉"
)
key
=
"abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
print
(
goods
)
# 要加密语句
\ No newline at end of file
message
=
"诺依,周末一起去看动漫展吧!"
key_message
=
""
# 请使用私钥key,对message进行加密
for
i
in
range
(
len
(
message
)):
a
=
message
[
i
]
b
=
random
.
choice
(
key
)
c
=
random
.
choice
(
key
)
d
=
a
+
b
+
c
key_message
=
key_message
+
d
print
(
key_message
)
message1
=
list
(
key_message
)
message1
.
insert
(
random
.
randint
(
0
,
len
(
message1
)),
"¥
%
……&*$
%
_*^&
%
(
%
^"
)
message2
=
""
.
join
(
message1
)
print
(
message2
)
\ No newline at end of file
三.py
0 → 100644
View file @
a2fd9188
# #第一题
# #第一题
# #打印hello world!
# print("hello world!")
# #第二题
# name = "悟空"
# word = "欢迎你"
# print(name+word)
#第三题
# num = 9
# float_num = 3.1415926
# name = "悟空"
# goods = ["雪碧", "可口可乐", "咖啡"]
# print(type(num))
# print(type(float_num))
# 第四题
# """
# 1、导入turtle模块,
# 2、创建画笔,
# 3、将画笔设置成海龟的形状,
# 4、控制画笔向前移动200,
# 5、并让画布保存在界面
# """
# import turtle
# pen=turtle.Pen())
# pen.shape("turtle")
# pen.forward(200)
# turrle.done()
#第五题
# """画出五角星"""
# import turtle
# """画出五角星"""
# pen=turtle.Pen()
# for i in range(5):
# pen.forward(500)
# pen.right(144)
# pen.hideturtle()
# turtle.done()
# 第六题
# import turtle
# """画出五角星,上色"""
# pen=turtle.Pen()
# pen.fellcolor(green)
# pen.begin_fill()
# for i in range(5):
# pen.forward(200)
# pen.right(144)
# pen.end_fill()
# pen.hideturtle()
# turtle.done()
#第七题
import
turtle
pen
=
turtle
.
Pen
()
pen
.
fillcolor
(
"red"
)
pen
.
begin_fill
()
for
i
in
range
(
50
):
pen
.
forward
(
50
)
pen
.
right
(
100
)
pen
.
end_fill
()
pen
.
hideturtle
()
turtle
.
done
()
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