Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-3
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
68919661
authored
Nov 19, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6635181e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
diy.py
diy3.py
diy4.py
diy.py
0 → 100644
View file @
68919661
import
turtle
screen
=
turtle
.
Screen
()
turtle
.
speed
(
"fast"
)
turtle
.
width
(
3
)
turtle
.
hideturtle
()
turtle
.
bgcolor
(
"black"
)
i
=
0
while
i
<
140
:
turtle
.
pencolor
(
"white"
)
turtle
.
penup
()
turtle
.
goto
(
0
,
0
)
turtle
.
fd
(
150
)
turtle
.
pendown
()
turtle
.
circle
(
100
)
turtle
.
lt
(
2
)
i
+=
1
turtle
.
done
()
\ No newline at end of file
diy3.py
0 → 100644
View file @
68919661
chengji
=
int
(
input
(
"请输入你的成绩:"
))
if
chengji
<
1
or
chengji
>
100
:
print
(
"成绩不合理,请重新输入"
)
elif
chengji
>=
90
:
print
(
"等级:A"
)
elif
chengji
>=
80
:
print
(
"等级:B"
)
elif
chengji
>=
60
:
print
(
"等级:C"
)
else
:
print
(
"等级:D"
)
import
random
a
=
random
.
randint
(
1
,
100
)
c
=
7
for
i
in
range
(
7
):
b
=
int
(
input
(
"请输入你要猜的数,有"
+
str
(
c
)
+
"次机会:"
))
if
a
==
b
:
print
(
"you won!"
)
break
elif
a
>
b
:
print
(
"low"
)
c
-=
1
else
:
print
(
"high"
)
c
-=
1
print
(
"right:
%
d"
%
a
)
diy4.py
0 → 100644
View file @
68919661
import
turtle
import
random
colorlist
=
[
'red'
,
'yellow'
,
'pink'
]
color
=
random
.
choice
(
colorlist
)
turtle
.
fillcolor
(
color
)
turtle
.
begin_fill
()
for
i
in
range
(
3
):
turtle
.
fd
(
200
)
turtle
.
lt
(
120
)
turtle
.
end_fill
()
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