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
9a60a277
authored
Nov 28, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b5c6bbbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
001.py
diy1.py
001.py
0 → 100644
View file @
9a60a277
# 玩家出拳
a
=
0
s_win
=
0
a_win
=
0
n_win
=
0
s
=
input
(
"请出剪刀,石头,布
\n
"
)
#s=player
a
+=
1
print
(
"现在是第"
+
str
(
a
)
+
"局"
)
print
(
"玩家出的是"
+
s
)
import
random
list
=
[
"剪刀"
,
"石头"
,
"布"
]
a
=
random
.
choice
(
list
)
#a=computer
print
(
"电脑出的是:"
+
a
)
if
s
==
a
:
print
(
"平局
\n
_________________"
)
elif
s
==
"布"
and
a
==
"石头"
\
or
s
==
"剪刀"
and
a
==
"布"
\
or
s
==
"石头"
and
a
==
"剪刀"
:
print
(
"你赢了
\n
_________________"
)
else
:
print
(
"你输了
\n
_________________"
)
\ No newline at end of file
diy1.py
0 → 100644
View file @
9a60a277
# 玩家出
s
=
input
(
"请出剪刀,石头,布
\n
"
)
#s=player
import
random
list
=
[
"剪刀"
,
"石头"
,
"布"
]
a
=
random
.
choice
(
list
)
#a=computer
if
s
in
list
:
print
(
"玩家出的是"
+
s
)
print
(
"电脑出的是:"
+
a
)
if
s
==
a
:
print
(
"平局
\n
_________________"
)
elif
s
==
"布"
and
a
==
"石头"
\
or
s
==
"剪刀"
and
a
==
"布"
\
or
s
==
"石头"
and
a
==
"剪刀"
:
print
(
"你赢了
\n
_________________"
)
else
:
print
(
"你输了
\n
_________________"
)
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