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
1129bde9
authored
May 25, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
b5c6bbbe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
diy1.py
diy1.py
0 → 100644
View file @
1129bde9
# 玩家出拳
import
random
answer
=
input
(
'尊敬的召唤师,您使用什么武器?(泣血之刃,制裁之刃,龙鳞短剑)'
)
print
(
'召唤师使用武器'
+
answer
)
list
=
[
'泣血之刃'
,
'制裁之刃'
,
'龙鳞短剑'
]
computer
=
random
.
choice
(
list
)
print
(
'觉悟人机使用武器'
+
computer
)
if
answer
in
list
:
if
answer
==
computer
:
print
(
'武器相同,请继续'
)
elif
(
answer
==
'泣血之刃'
and
computer
==
'龙鳞短剑'
)
or
(
answer
==
'制裁之刃'
and
computer
==
'泣血之刃'
)
or
(
answer
==
'龙鳞短剑'
and
computer
==
'制裁之刃'
):
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