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
8489a671
authored
Feb 24, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
457edf1c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
diy1.py
diy1.py
View file @
8489a671
p
=
input
(
"请出拳:石头/剪刀/布"
)
# 玩家出拳
print
(
"玩家出拳:"
+
p
layer
)
print
(
"玩家出拳:"
+
p
)
from
random
import
*
list
=
[
"石头"
,
"剪刀"
,
"布"
]
cr
=
choice
(
list
)
print
(
"电脑出拳"
+
cr
)
if
p
==
cr
:
if
p
in
list
:
if
p
==
cr
:
print
(
"平局,再来一次"
)
elif
(
p
==
"石头"
and
cr
==
"剪刀"
)
or
(
p
==
"剪刀"
and
cr
==
"布"
)
or
(
p
==
"布"
and
cr
==
"石头"
):
elif
(
p
==
"石头"
and
cr
==
"剪刀"
)
or
(
p
==
"剪刀"
and
cr
==
"布"
)
or
(
p
==
"布"
and
cr
==
"石头"
):
print
(
"计算机输了,运气真不好,恭喜你"
)
else
:
else
:
print
(
"你竟然输了,真笨"
)
else
:
print
(
"你竟然连石头·剪刀·布都不会玩,真是太太笨了"
)
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