Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-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
f5ad02ad
authored
Dec 12, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d622f6d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
diy4.py
diy5
diy4.py
View file @
f5ad02ad
def
pri
():
print
(
"你赢"
)
guanqiashu
=
input
(
"数量:"
)
for
i
in
range
(
0
,
int
(
guanqiashu
),
1
):
passs
=
input
(
"玩家请出拳(石头/剪刀/布):"
)
print
(
"玩家出拳:"
,
passs
)
print
(
"玩家出拳:
\n
"
,
passs
)
#计算机出拳
import
random
list
=
[
"剪刀"
,
"石头"
,
"布"
]
hello
=
random
.
choice
(
list
)
print
(
"电脑出拳:
\n
"
,
hello
)
if
passs
==
hello
:
print
(
"平局"
)
elif
passs
==
"石头"
and
hello
==
"剪刀"
:
pri
()
elif
passs
==
"剪刀"
and
hello
==
"布"
:
pri
()
elif
passs
==
"布"
and
hello
==
"石头"
:
pri
()
else
:
print
(
"电脑胜利"
)
\ No newline at end of file
diy5
0 → 100644
View file @
f5ad02ad
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