Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
6bb42a9b
authored
May 01, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a51377af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
diy.py
diy.py
View file @
6bb42a9b
...
...
@@ -12,8 +12,33 @@ class Hero:
Houyi
=
Hero
(
"后羿"
,
240
,
23
)
print
(
"后羿的初始等级为:"
,
Houyi
.
level
)
print
(
"后羿的初始血量为:"
,
Houyi
.
hp
)
print
(
"后羿的初始攻击力为:"
,
Houyi
.
attack
)
Houyi
.
upgrade
()
Houyi
.
upgrade
()
#升级几次就调用几次
print
(
"*"
*
50
)
# *星号隔开
print
(
"升级两次后后羿的等级为:"
,
Houyi
.
level
)
print
(
"升级两次后后羿的血量为:"
,
Houyi
.
hp
)
print
(
"升级两次后后羿的攻击力为:"
,
Houyi
.
attack
)
print
(
"*"
*
50
)
# *星号隔开
yase
=
Hero
(
"亚瑟"
,
300
,
20
)
print
(
"亚瑟的初始等级为:"
,
yase
.
level
)
print
(
"亚瑟的初始血量为:"
,
yase
.
hp
)
print
(
"亚瑟的初始攻击力为:"
,
yase
.
attack
)
yase
.
upgrade
()
yase
.
upgrade
()
#升级几次就调用几次
print
(
"*"
*
50
)
# *星号隔开
print
(
"升级两次后亚瑟的等级为:"
,
yase
.
level
)
print
(
"升级两次后亚瑟的血量为:"
,
yase
.
hp
)
print
(
"升级两次后亚瑟的攻击力为:"
,
yase
.
attack
)
print
(
"等级为:"
,
Houyi
.
level
)
print
(
"血量为:"
,
Houyi
.
hp
)
print
(
"攻击力为:"
,
Houyi
.
attack
)
\ No newline at end of file
print
(
"*"
*
50
)
# *星号隔开
\ 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