Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_DIY1
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
f1ce4451
authored
Nov 08, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
497edd6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
111.py
diy1.py
111.py
View file @
f1ce4451
import
turtle
pen
=
turtle
.
Pen
()
pen
.
color
()
python
中
turtle
的命令
turtle
.
done
()
diy1.py
View file @
f1ce4451
for
i
in
range
(
1
,
10
):
weapon
=
[
"火箭筒"
,
1
,
2
,
3
,
4
,
5
,
6
]
for
j
in
range
(
1
,
i
+
1
):
#创建列表
print
(
'
%
s*
%
s=
%
s'
%
(
j
,
i
,
i
*
j
),
end
=
' '
)
print
(
)
weapon
[
0
]
\ No newline at end of file
#提取内容
weapon
[
0
]
=
"手雷"
#更换内容
weapon
.
clear
()
#清除全部
#列表里插入内容
#格式:列表名.insert(索引,"加进去的内容")
weapon
.
insert
(
2
,
"插班生"
)
#记录列表长度(数有多少个)
#格式 len(列表名)
len
(
weapon
)
while
i
<
len
(
weapon
):
\ 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