Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_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
8ce9d923
authored
Mar 12, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
ed89be02
Pipeline
#5124
failed in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
7 deletions
2.py
3.py
diy1.py
2.py
0 → 100644
View file @
8ce9d923
annnnn
=
input
(
"请输入你要便利的字符:"
)
for
i
in
annnnn
:
print
(
i
)
3.py
0 → 100644
View file @
8ce9d923
#调用 random 模块
import
random
#Key=&^*&*^*
#message =%^&*(*&^&^)
key
=
"何况人him慧可慧可慧可红恶口可调节诶是看过么就下诶赛车看完记得家啊卡基督教思想开车门吗我就在空间查看vii下"
message
=
"贾晓鹏,周末一起打游戏吧(heping)"
#把random中的choice赋值给str
str
=
random
.
choice
(
key
)
#把密钥赋值
key_messge
=
""
#for 的便利
for
i
in
message
:
#调用random中的choice赋值给a1a2a3
a1
=
random
.
choice
(
key
)
a2
=
random
.
choice
(
message
)
a3
=
random
.
choice
(
message
)
#把a1a2a3赋值给texe
texe
=
a1
+
a2
+
a3
#防止覆盖
key_messge
=
key_messge
+
texe
#打印key_messge
print
(
key_messge
)
diy1.py
View file @
8ce9d923
students
=
[
"悟空"
,
"小贝"
,
"八戒"
,
"波奇"
]
# 八戒因为要回老家,转学了,请将八戒从班级列表名单中删除
?
# 班上来了一个新同学,名叫"诺依",请将"诺依"加入到班级名单里面
?
students
.
pop
(
-
2
)
print
(
students
)
# 班上来了一个新同学,名叫"诺依",请将"诺依"加入到班级名单里面
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
students
.
append
(
"诺依"
print
(
students
)
# 班上准备开始辩论赛,分为红(red)、蓝(blue)组,
# 请用切片将班级列表的前2名加入到红组,后2名加入到蓝组
red
=
?
blue
=
?
red
=
students
[:
2
]
blue
=
students
[
2
:]
print
(
red
)
print
(
blue
)
\ 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