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
db39e4a1
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
309718c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
diy1.py
diy1.py
View file @
db39e4a1
...
@@ -4,10 +4,14 @@ import random
...
@@ -4,10 +4,14 @@ import random
list1
=
[
"石头"
,
"剪刀"
,
"布"
]
list1
=
[
"石头"
,
"剪刀"
,
"布"
]
letter
=
random
.
choice
(
list1
)
letter
=
random
.
choice
(
list1
)
print
(
letter
)
print
(
letter
)
if
player
==
letter
:
if
player
in
[
"石头"
,
"剪刀"
,
"布"
]:
print
(
"平局"
)
if
player
==
letter
:
elif
(
player
==
"石头"
and
letter
==
"剪刀"
)
or
(
player
==
"剪刀"
and
letter
==
"布"
)
or
(
player
==
"布"
and
letter
==
"石头"
):
print
(
"平局"
)
print
(
"赢了"
)
elif
(
player
==
"石头"
and
letter
==
"剪刀"
)
or
(
player
==
"剪刀"
and
letter
==
"布"
)
or
(
player
==
"布"
and
letter
==
"石头"
):
print
(
"赢了"
)
else
:
print
(
"输了"
)
else
:
else
:
print
(
"输了"
)
print
(
"错误"
)
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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