Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-3-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
372127d5
authored
Jul 18, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
b7ecd61c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
diy1.py
diy1.py
View file @
372127d5
# 玩家
import
random
w
=
input
(
"爱子出拳"
)
print
(
"爱子出拳"
+
w
)
list
=
[
"剪刀"
,
"石头"
,
"布"
]
c
=
random
.
choice
(
list
)
print
(
"老子出拳"
+
c
)
\ No newline at end of file
while
True
:
w
=
input
(
"爱子出拳"
)
print
(
"爱子出拳"
+
w
)
list
=
[
"剪刀"
,
"石头"
,
"布"
]
c
=
random
.
choice
(
list
)
print
(
"老子出拳"
+
c
)
#果
if
w
==
c
:
print
(
"哟!平局了"
)
elif
(
w
==
"石头"
and
c
==
"剪刀"
)
or
(
w
==
"剪刀"
and
c
==
"布"
)
or
(
w
==
"布"
and
c
==
"石头"
):
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