Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_2
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
50336a0c
authored
May 12, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a30b718f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
diy2.py
diy2.py
View file @
50336a0c
message
=
"大香蕉,一条大香蕉,hi!你的感觉真的很奇妙"
message
=
"大香蕉,一条大香蕉,hi!你的感觉真的很奇妙"
key
=
"前轱辘不转后轱辘转思密达"
key
=
"前轱辘不转后轱辘转思密达"
key2
=
"你干嘛"
import
random
import
random
# 请对message进行遍历,取出所有元素
# 请对message进行遍历,取出所有元素
m
=
""
m
=
""
...
@@ -9,5 +10,10 @@ for i in message:
...
@@ -9,5 +10,10 @@ for i in message:
str3
=
random
.
choice
(
key
)
str3
=
random
.
choice
(
key
)
text
=
str1
+
str2
+
str3
text
=
str1
+
str2
+
str3
m
=
m
+
text
m
=
m
+
text
print
(
m
)
listm
=
list
(
m
)
index
=
random
.
randint
(
0
,
len
(
listm
))
listm
.
insert
(
index
,
key2
)
m1
=
""
.
join
(
listm
)
print
(
m1
)
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