Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-2_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
116b0f0d
authored
Aug 13, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
09d167bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
diy1.py
diy1.py
View file @
116b0f0d
list
=
[
'石'
,
"剪"
,
"布"
]
list
=
[
'石'
,
"剪"
,
"布"
]
import
random
\ No newline at end of file
while
True
:
play
=
input
(
"出拳"
)
if
play
in
list
:
print
(
"play"
+
play
)
list
=
[
'石'
,
"剪"
,
"布"
]
cumputer
=
random
.
choice
(
list
)
print
(
"cumputer"
+
cumputer
)
if
play
==
cumputer
:
print
(
"平"
)
elif
(
play
==
"布"
and
cumputer
==
"石"
)
or
(
play
==
"剪"
and
cumputer
==
"布"
)
or
(
play
==
"石"
and
cumputer
==
"剪"
):
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