Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-3-1_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
8bd9dcf7
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
6053728e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
diy333.py
review.py
diy333.py
View file @
8bd9dcf7
# 玩家出拳
player
=
input
(
"请准备出拳(石头/剪刀/布):"
)
print
(
"玩家出拳:"
+
player
)
#电脑出拳
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
list
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list
)
print
(
computer
)
print
(
"电脑出拳:"
+
computer
)
#判断结果
if
player
in
list
:
if
player
==
computer
:
print
(
"哇哦,居然是平局"
)
elif
(
player
==
"剪刀"
and
computer
==
"布"
)
or
(
player
==
"石头"
and
computer
==
"剪刀"
)
or
(
player
==
"布"
and
computer
==
"石头"
):
print
(
"我的天哪!你居然赢了?!"
)
else
:
print
(
"输给我这么优秀的电脑是正常的,不要灰心哈!诶嘿!"
)
else
:
print
(
"输入内容出错啦!"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
review.py
0 → 100644
View file @
8bd9dcf7
import
turtle
p
=
turtle
.
Pen
()
p
.
shape
(
"turtle"
)
p
.
color
(
"red"
,
"blue"
)
p
.
width
(
15
)
p
.
speed
(
5
)
p
.
begin_fill
()
p
.
circle
(
80
)
p
.
end_fill
()
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