Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_5
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
1a77d672
authored
Apr 15, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d5a5c7c3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
6 deletions
demo-1.py
demo-2.py
demo-3.py
demo.py
diy2.py
demo-1.py
0 → 100644
View file @
1a77d672
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
i
,
"*"
,
j
,
"="
,(
j
*
i
),
end
=
" "
)
print
()
\ No newline at end of file
demo-2.py
0 → 100644
View file @
1a77d672
list
=
[
'苹果'
,
'香蕉'
,
'西瓜'
,
'香蕉'
,
'桃子'
,
'香蕉'
]
for
i
in
range
(
3
):
list
.
remove
(
'香蕉'
)
print
(
list
)
demo-3.py
0 → 100644
View file @
1a77d672
a
=
[
"华雄"
]
b
=
[
"关羽"
,
"刘备"
,
"张飞"
]
b
.
pop
(
0
)
a
.
insert
(
0
,
"关羽"
)
print
(
b
)
print
(
a
)
a
=
[
'华雄'
]
c
=
[
'颜良'
,
'文丑'
]
a
.
extend
(
c
)
print
(
a
)
\ No newline at end of file
demo.py
0 → 100644
View file @
1a77d672
import
turtle
#导入画笔工具
pen
=
turtle
.
Pen
()
#创建画笔
colors
=
[
"red"
,
"yellow"
,
"blue"
,
"green"
]
#创建边长变量
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"black"
)
for
i
in
range
(
1
,
9999
):
#进入循环300次
pen
.
pencolor
(
colors
[
i
%
4
])
pen
.
forward
(
i
)
#画笔每次移动lenth长度
pen
.
left
(
91
)
#画笔左转91度 #长度加1
pen
.
hideturtle
()
#隐藏画笔
turtle
.
done
()
diy2.py
View file @
1a77d672
...
@@ -23,9 +23,3 @@ while True:
...
@@ -23,9 +23,3 @@ while True:
exit
()
exit
()
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