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
fc9b6bf9
authored
Jan 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
7aba3e56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
s.py
s.py
View file @
fc9b6bf9
import
random
import
random
#玩家出拳
player
=
input
(
"请输入:"
)
player
=
input
(
"请输入:"
)
print
(
"玩家请出拳:"
+
player
)
print
(
"玩家请出拳:"
+
player
)
#创建列表
list
=
[
"石头"
,
"剪刀"
,
"布"
]
list
=
[
"石头"
,
"剪刀"
,
"布"
]
#计算机出拳
computer
=
random
.
choice
(
list
)
computer
=
random
.
choice
(
list
)
print
(
"计算机出拳:"
+
computer
)
print
(
"计算机出拳:"
+
computer
)
#判断玩家出拳是否符合规定并判断游戏结果
if
player
in
list
:
if
player
in
list
:
if
player
==
computer
:
if
player
==
computer
:
print
(
"平局"
)
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