Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_1
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
d61fc25e
authored
Apr 16, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4dbc2f61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
diy1.py
diy1.py
View file @
d61fc25e
...
@@ -17,7 +17,14 @@ class Hero(object):
...
@@ -17,7 +17,14 @@ class Hero(object):
else
:
else
:
info3
=
enemy
.
name
+
"阵亡,游戏结束"
info3
=
enemy
.
name
+
"阵亡,游戏结束"
info
=
info1
+
info2
+
info3
info
=
info1
+
info2
+
info3
rint
(
info
)
print
(
info
)
yase
=
Hero
(
"垭瑟"
)
exit
()
houyi
=
Hero
(
"后羿"
)
class
player
(
hero
):
yase
.
combat
(
houyi
)
def
__init__
(
self
,
name
):
\ No newline at end of file
super
.
__init__
()
self
.
hp
=
200
self
.
attack
=
50
player
=
player
(
"后羿"
)
print
(
"玩家血量为:"
,
player
.
hp
)
print
(
"玩家攻击力为:"
,
player
.
attack
)
\ 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