Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-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
415daea3
authored
Nov 07, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
50c61398
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
aa.py
aa.py
View file @
415daea3
aa
=
input
(
'你出什么'
)
while
True
:
print
(
'玩家出拳'
+
aa
)
aa
=
input
(
'你出什么'
)
import
random
print
(
'玩家出拳'
+
aa
)
list1
=
[
"石头"
,
'剪刀'
,
"布"
]
import
random
bb
=
random
.
choice
(
list1
)
list1
=
[
"石头"
,
'剪刀'
,
"布"
]
print
(
"电脑出拳"
+
bb
)
bb
=
random
.
choice
(
list1
)
print
(
"电脑出拳"
+
bb
)
if
aa
in
list1
:
if
aa
==
bb
:
print
(
'平局'
)
elif
aa
==
'剪刀'
and
bb
==
"布"
or
aa
==
'布'
and
bb
==
'石头'
or
aa
==
'石头'
and
bb
==
'剪刀'
:
print
(
'玩家赢'
)
else
:
print
(
'你输了'
)
else
:
if
aa
==
p
:
break
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