Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_1
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
0fa324b8
authored
Sep 15, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c1f6aa03
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
11 deletions
func.py
vvv.py
func.py
View file @
0fa324b8
def
new_input
():
import
turtle
total
=
[]
while
True
:
# 设置画布大小
unit
=
input
(
"请输入:"
)
turtle
.
setup
(
400
,
400
)
if
unit
==
'q'
:
break
# 创建画笔
else
:
pen
=
turtle
.
Pen
()
total
.
append
(
unit
)
pen
.
width
(
20
)
print
(
total
)
new_input
()
# 设置起始位置
\ No newline at end of file
pen
.
penup
()
pen
.
goto
(
-
50
,
100
)
pen
.
pendown
()
# 绘制Z形图形
pen
.
forward
(
200
)
pen
.
right
(
135
)
pen
.
forward
(
280
)
pen
.
left
(
135
)
pen
.
forward
(
200
)
# 隐藏画笔
pen
.
hideturtle
()
# 关闭画布
turtle
.
done
()
\ No newline at end of file
vvv.py
0 → 100644
View file @
0fa324b8
size
=
int
(
input
(
"请输入正方形的边长"
))
a
=
4
*
size
b
=
size
*
size
print
(
"正方形的周长是:"
+
str
(
a
))
print
(
"正方形的面积是:"
+
str
(
b
))
\ 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