Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-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
030d424c
authored
Dec 11, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
36f9774b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
diy1_1.py
diy2022.10.14.py
diy1_1.py
0 → 100644
View file @
030d424c
name
=
input
(
"请输入"
)
print
(
int
(
name
))
\ No newline at end of file
diy2022.10.14.py
0 → 100644
View file @
030d424c
import
turtle
pen
=
turtle
.
Pen
()
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"light blue"
)
len
=
int
(
screen
.
textinput
(
"提示1"
,
"你想要多大的花啊,
\n
注:太大会超出屏幕的!"
))
n
=
int
(
screen
.
textinput
(
"提示2"
,
"你想要几个花瓣,
\n
注:太大会超出屏幕的!"
))
pen
.
penup
()
pen
.
goto
(
60
,
-
120
)
pen
.
write
(
"你好啊,诺一,
\n
最近吃胖没有啊"
,
font
=
(
"Times"
,
20
,
"normal"
))
pen
.
hideturtle
()
pen
.
goto
(
-
100
,
0
)
pen
.
pendown
()
pen
.
speed
(
100
)
# len=100
# n=12
pen
.
fillcolor
(
"red"
)
pen
.
begin_fill
()
for
i
in
range
(
n
):
pen
.
forward
(
len
)
pen
.
left
(
360
/
n
)
pen
.
end_fill
()
for
i
in
range
(
n
):
pen
.
right
(
90
)
pen
.
circle
(
len
/
2
,
180
)
#第一个参数是画出圆的半径 第二参数是画出圆的角度,这是决定是圆还是半圆还是扇形
pen
.
right
(
90
)
pen
.
left
(
360
/
n
)
turtle
.
done
()
# pen.fillcolor("red") # 设置填充的颜色
# pen.begin_fill() # 开始填充
# for i in range(130): #重复执行五次,让画笔移动200,右转144度
# pen.forward(200)
# pen.right(166)
# pen.end_fill() # 结束填充
\ 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