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
a03e7642
authored
Jun 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b5c6bbbe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
石头剪刀布.py
石头剪刀布.py
0 → 100644
View file @
a03e7642
# 计算机
# 计算机
import
random
list1
=
[
"石头"
,
"剪刀"
,
"布"
]
computer
=
random
.
choice
(
list1
)
# 用户
user
=
input
(
"请输入石头/剪刀/布:"
)
if
user
in
list1
:
if
computer
==
user
:
print
(
"平局"
)
elif
(
computer
==
"石头"
and
user
==
"布"
)
or
(
computer
==
"布"
and
user
==
"剪刀"
)
or
(
computer
==
"剪刀"
and
user
==
"石头"
):
print
(
"赢了"
)
else
:
print
(
"输了"
)
else
:
print
(
"用户输入错误!"
)
\ No newline at end of file
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