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
9eae9b3b
authored
Nov 24, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4cac003e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
diy1.py
diy1.py
View file @
9eae9b3b
neme
=
input
(
"输入名字"
)
print
(
neme
+
"你好啊"
)
\ No newline at end of file
import
turtle
c
=
[
"red"
,
"green"
,
"blue"
,
"yellow"
,
"orange"
]
#存储颜色
s
=
turtle
.
Screen
()
#定义背景
s
.
bgcolor
(
"pink"
)
#设置背景颜色为pink
p
=
turtle
.
Pen
()
#定义画笔
p
.
speed
(
200
)
#设置画笔速度为200
for
i
in
range
(
1
,
300
):
#利用for循环画图形
p
.
pencolor
(
c
[
i
%
5
])
#每次循环的图形边的颜色
p
.
forward
(
i
)
#每次循环图形的边都加1
p
.
right
(
144
)
#每次循环图形旋转的角度
p
.
hideturtle
()
turtle
.
done
()
\ 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