Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_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
e0279d93
authored
Apr 27, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d2109113
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
diy1.py
diy1.py
View file @
e0279d93
player
=
input
(
"请出拳(石头/剪刀/布):"
)
while
True
:
print
(
"玩家出拳:"
+
player
)
player
=
input
(
"请出拳(石头/剪刀/布):"
)
import
random
print
(
"玩家出拳:"
+
player
)
list1
=
[
"剪刀"
,
"石头"
,
"布"
]
import
random
cmp
=
random
.
choice
(
list1
)
list1
=
[
"剪刀"
,
"石头"
,
"布"
]
print
(
"电脑出拳:"
+
cmp
)
cmp
=
random
.
choice
(
list1
)
if
cmp
==
player
:
print
(
"电脑出拳:"
+
cmp
)
print
(
"平局"
)
if
player
in
list1
:
elif
player
==
"剪刀"
and
cmp
==
"布"
or
player
==
"石头"
and
cmp
==
"剪刀"
or
player
==
"布"
and
cmp
==
"石头"
:
if
cmp
==
player
:
print
(
"你赢了!!!!!!!!!!!"
)
print
(
"平局"
)
else
:
elif
player
==
"剪刀"
and
cmp
==
"布"
or
player
==
"石头"
and
cmp
==
"剪刀"
or
player
==
"布"
and
cmp
==
"石头"
:
print
(
"你死了!!!"
)
print
(
"你赢了!!!!!!!!!!!"
)
\ No newline at end of file
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