Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_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
2d935255
authored
Jul 28, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a13f5bbc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
27 deletions
123.py
diy1.py
123.py
View file @
2d935255
import
turtle
pen
=
turtle
.
Pen
()
pen
.
write
(
"锄禾日当午,
\n
汗滴禾下土。"
,
font
=
(
"Times"
,
30
,
"normal"
))
pen
.
hideturtle
()
turtle
.
done
\ No newline at end of file
# pen = turtle.Pen()
# pen.write("锄禾日当午,\n汗滴禾下土。",font=("Times",30,"normal"))
# pen.hideturtle()
# turtle.done()
pen
=
turtle
.
Pen
()
pen
.
shape
(
"turtle"
)
pen
.
left
(
45
)
forward
(
100
)
pen
.
extent
(
50
,
180
)
pen
.
right
(
90
)
pen
.
extent
(
50
,
180
)
forward
(
100
)
turtle
.
done
()
\ No newline at end of file
diy1.py
View file @
2d935255
#
while
True
:
player
=
input
(
"请出拳(石头/剪刀/布):"
)
print
(
"玩家出拳:"
+
player
)
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list
)
print
(
"电脑出拳:"
+
computer
)
if
player
in
list
:
if
player
==
computer
:
input
(
"平局"
)
elif
(
player
==
"石头"
)
and
(
computer
==
"剪刀"
):
input
(
"赢了"
)
elif
(
player
==
"布"
)
and
(
computer
==
"石头"
):
input
(
"赢了"
)
elif
(
player
==
"剪刀"
)
and
(
computer
==
"布"
):
input
(
"赢了"
)
else
:
print
(
"输了"
)
else
:
print
(
"输入错误"
)
\ No newline at end of file
import
turtle
# pen = turtle.Pen()
# pen.write("锄禾日当午,\n汗滴禾下土。",font=("Times",30,"normal"))
# pen.hideturtle()
# turtle.done()
pen1
=
turtle
.
Pen
()
pen1
.
shape
(
"turtle"
)
pen1
.
color
(
"green"
)
pen1
.
pensize
(
5
)
pen1
.
left
(
45
)
pen1
.
forward
(
100
)
pen1
.
circle
(
50
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
50
,
180
)
pen1
.
forward
(
100
)
pen1
.
turtle
.
hide
turtle
.
done
()
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