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
1d0b7a6b
authored
Sep 11, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
33f50bab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
15 deletions
demo.py
diy4.py
i.py/KKKKK.PY
demo.py
0 → 100644
View file @
1d0b7a6b
'''
创建两个集合储数据
num:存储的是学生的成绩
name:存储的是学员的名字
'''
#创建第一的集合存储学员的成绩
num
=
[
90
,
99
,
67
,
98
,
89
,
30
,
77
,
59
,
61
,
88
]
#创建第二个集合存储学员的名字
name
=
[
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
,
'g'
,
'h'
,
'i'
,
'j'
]
#使用循环遍历成绩集合
for
i
in
num
:
#判断成绩是否是小于60
if
i
<
60
:
#temp存储成绩下标
temp
=
num
.
index
(
i
)
#使用成绩的下标在成绩集合找到对应的学员
n
=
name
[
temp
]
#输出学员的姓名以及成绩
print
(
n
,
'的成绩为:'
,
i
)
\ No newline at end of file
diy4.py
View file @
1d0b7a6b
import
random
import
turtle
'''
#创建画笔
pen = turtle.Pen()
#给五角星填充红色
pen.fillcolor("red")
#填充开始
pen.begin_fill()
#for循环循环五次画出五角星
for i in range(5):
#画笔移动200步
pen.forward(200)
#右转144度
pen.right(144)
#填充结束
pen.end_fill()
#画笔隐藏
pen.hideturtle()
#画笔结束并停止
pen.down()
# 私钥
pen = turtle.Pen()
key
=
"abcdefgh使用编程实现位移替换加密,制作密码机关真是太好玩了哈哈!"
pen.fillcolor("red")
# 要加密语句
pen.begin_fill()
message
=
"诺依,周末一起去看动漫展吧!"
for i in range(36):
pen.forward(200) # 移动200
key_message
=
""
# 请使用私钥key,对message进行加密
pen.left(170) # 改变方向
for
i
in
message
:
str3
=
i
str1
=
random
.
choice
(
key
)
str2
=
random
.
choice
(
key
)
text
=
str3
+
str2
+
str1
key_message
=
key_message
+
text
print
(
key_message
)
pen.end_fill()
pen.hideturtle()
turtle.done()
'''
name
=
"速递收到"
print
(
type
(
name
))
\ No newline at end of file
i.py/KKKKK.PY
0 → 100644
View file @
1d0b7a6b
W
\ 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