Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-4
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
e842fa60
authored
Jan 22, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
abf9421e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
26 deletions
a.py
b.py
c.py
quiz.py
qwert.py
a.py
View file @
e842fa60
import
turtle
as
t
t
.
fillcolor
(
"yellow"
)
#脸
t
.
begin_fill
()
t
.
circle
(
70
)
t
.
end_fill
()
#脸 结束
t
.
penup
()
#耳朵1
t
.
goto
(
50
,
120
)
t
.
pendown
()
t
.
begin_fill
()
t
.
circle
(
20
,
300
)
t
.
penup
()
t
.
forward
(
100
)
t
.
left
(
90
)
t
.
forward
(
100
)
t
.
left
(
90
)
t
.
end_fill
()
t
.
goto
(
46
,
122
)
t
.
setheading
(
15
)
t
.
pendown
()
t
.
fillcolor
(
"pink"
)
t
.
begin_fill
()
t
.
circle
(
11
,
260
)
t
.
penup
()
t
.
end_fill
()
t
.
home
()
#耳朵2
t
.
right
(
180
)
t
.
goto
(
-
50
,
120
)
t
.
pendown
()
t
.
fillcolor
(
"yellow"
)
t
.
begin_fill
()
t
.
circle
(
-
20
,
300
)
t
.
end_fill
()
t
.
penup
()
t
.
home
()
t
.
right
(
180
)
t
.
goto
(
-
46
,
122
)
t
.
pendown
()
for
i
in
range
(
4
):
t
.
forward
(
200
)
t
.
left
(
90
)
t
.
fillcolor
(
"pink"
)
t
.
begin_fill
()
t
.
circle
(
-
11
,
280
)
t
.
end_fill
()
t
.
penup
()
t
.
forward
(
100
)
t
.
goto
(
-
48
,
122
)
t
.
penup
()
#头 结束
t
.
pensize
(
5
)
t
.
goto
(
-
10
,
130
)
#王
t
.
pendown
()
t
.
setheading
(
0
)
t
.
forward
(
20
)
t
.
forward
(
-
10
)
t
.
right
(
90
)
t
.
forward
(
10
)
t
.
left
(
90
)
t
.
forward
(
100
)
t
.
forward
(
10
)
t
.
forward
(
-
20
)
t
.
forward
(
10
)
t
.
right
(
90
)
t
.
forward
(
5
0
)
t
.
forward
(
1
0
)
t
.
left
(
90
)
t
.
fillcolor
(
"blue"
)
t
.
forward
(
10
)
t
.
forward
(
-
20
)
t
.
forward
(
10
)
t
.
penup
()
#王 结束
t
.
goto
(
35
,
70
)
#眼睛
t
.
pensize
(
10
)
t
.
dot
()
t
.
pensize
(
2
)
t
.
pencolor
(
"white"
)
t
.
goto
(
34
,
71
)
t
.
dot
()
t
.
pencolor
(
"black"
)
t
.
goto
(
-
35
,
70
)
t
.
pensize
(
10
)
t
.
dot
()
t
.
pensize
(
2
)
t
.
pencolor
(
"white"
)
t
.
goto
(
-
36
,
71
)
t
.
dot
()
#眼睛 结束
# t.goto(-50,15)#线条
# t.pensize(5)
# t.pencolor("brown")
# t.forward(10)
# t.forward(-10)
# t.penup()
# t.goto(48,14)
# t.pendown()
# t.forward(7)
t
.
fillcolor
(
"white"
)
#嘴巴
t
.
begin_fill
()
t
.
pencolor
(
"black"
)
t
.
pensize
(
1
)
t
.
goto
(
45
,
16
)
t
.
setheading
(
105
)
t
.
pendown
()
t
.
begin_fill
()
t
.
circle
(
45
,
150
)
t
.
setheading
(
-
39
)
t
.
circle
(
70
,
90
)
t
.
end_fill
()
t
.
penup
()
t
.
goto
(
-
20
,
25
)
t
.
setheading
(
-
90
)
t
.
pendown
()
t
.
circle
(
10
,
180
)
t
.
right
(
180
)
t
.
circle
(
10
,
180
)
t
.
penup
()
#嘴巴 结束
t
.
fillcolor
(
"pink"
)
#鼻子
t
.
begin_fill
()
t
.
circle
(
50
)
t
.
goto
(
-
12
,
50
)
t
.
pendown
()
t
.
circle
(
-
12
)
t
.
end_fill
()
t
.
hideturtle
()
t
.
done
()
\ No newline at end of file
b.py
View file @
e842fa60
a
=
6
#长方形的长
b
=
3
#长方形的宽
s
=
a
*
b
#长方形的面积
print
(
"长方形的面积为:"
+
str
(
s
))
#输出长方形的面积
\ No newline at end of file
class
Hero
:
#设置一个英雄类
def
__init__
(
self
):
#定义英雄属性
self
.
level
=
1
self
.
hp
=
300
self
.
attack
=
20
yase
=
Hero
()
print
(
yase
)
\ No newline at end of file
c.py
0 → 100644
View file @
e842fa60
a
=
int
(
input
(
"输入一个数字"
))
list
=
[]
for
i
in
range
(
1
,
a
+
1
):
list
.
append
(
i
)
print
(
list
)
c
=
0
while
True
:
if
len
(
list
)
==
1
:
break
else
:
b
=
list
[
0
]
list
.
pop
(
0
)
c
+=
1
if
c
==
3
:
c
=
0
continue
else
:
list
.
append
(
b
)
print
(
list
)
\ No newline at end of file
quiz.py
View file @
e842fa60
# 勇于挑战的创造师,下面的代码犯了两类典型错误,请你把bug揪出来吧。
area
=
[
'盘丝洞'
,
'白骨洞'
,
'大雁塔'
]
monster
=
{
'盘丝洞'
:
'蜘蛛精'
,
'白骨洞'
:
'白骨精'
,
'大雁塔'
:
'花妖'
}
# 打印出大雁塔
print
(
area
[
2
])
# 向字典中添加 '地府':'僵尸'
monster
[
'地府'
]
=
'僵尸'
print
(
monster
)
\ No newline at end of file
a
=
int
(
input
(
"输入一个数"
))
b
=
0
for
i
in
range
(
1
,
a
+
1
):
b
+=
i
print
(
"一共发了"
+
str
(
b
)
+
"个金币"
)
\ No newline at end of file
qwert.py
0 → 100644
View file @
e842fa60
import
turtle
as
t
t
.
penup
()
t
.
forward
(
100
)
t
.
left
(
90
)
t
.
forward
(
100
)
t
.
left
(
90
)
t
.
pendown
()
for
i
in
range
(
4
):
t
.
forward
(
200
)
t
.
left
(
90
)
t
.
penup
()
t
.
forward
(
100
)
t
.
left
(
90
)
t
.
forward
(
100
)
t
.
right
(
90
)
t
.
forward
(
50
)
t
.
left
(
90
)
t
.
fillcolor
(
"blue"
)
t
.
pendown
()
t
.
begin_fill
()
t
.
circle
(
50
)
t
.
end_fill
()
t
.
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