Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-5-2
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
3bc25dae
authored
9 months ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
00b18051
c307554l803p219a8311/wx395554
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
diy.py
diy.py
View file @
3bc25dae
# 挑战赛
import
turtle
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
#pen=turtle.Pen()
name
=
input
(
'名字'
)
#pen.write("Hi,诺依~\n用python写电子贺卡真是太有趣啦~\n我也喜欢python~\n-悟空",font=("Times",20,"normal"))
power
=
int
(
input
(
'臂力'
))
#pen.hideturtle()
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
#画圆
# 自动排序
pen1
=
turtle
.
Pen
()
for
i
in
range
(
1
,
len
(
hero
),
2
):
pen1
.
pensize
(
10
)
if
hero
[
i
]
>=
power
:
pen1
.
pencolor
(
"red"
)
hero
.
insert
(
i
-
1
,
name
)
pen1
.
left
(
45
)
hero
.
insert
(
i
,
power
)
pen1
.
forward
(
200
)
break
pen1
.
circle
(
100
,
180
)
print
(
hero
[
-
6
:]
)
pen1
.
right
(
90
)
\ No newline at end of file
pen1
.
circle
(
100
,
180
)
pen1
.
forward
(
200
)
turtle
.
done
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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