Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13_2
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
a0950308
authored
Jul 18, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e11daca3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
1.py
1.py
View file @
a0950308
...
...
@@ -8,10 +8,10 @@ class Hero:
self
.
name
=
name
#英雄姓名
self
.
hp
=
hp
#英雄血量
self
.
attack
=
attack
#英雄攻击力
def
upgrade
(
):
yase
.
level
=
yase
.
level
+
1
yase
.
hp
=
yase
.
hp
+
50
yase
.
attack
=
yase
.
attack
+
10
def
upgrade
(
self
):
self
.
level
=
self
.
level
+
1
self
.
hp
=
self
.
hp
+
50
self
.
attack
=
self
.
attack
+
10
yase
=
Hero
(
'亚瑟'
,
500
,
35
)
houyi
=
Hero
(
'后羿'
,
350
,
50
)
BLSY
=
Hero
(
'百里守约'
,
360
,
60
)
...
...
@@ -22,3 +22,7 @@ print('后羿的生命值为',houyi.hp)
print
(
'百里守约的生命值为'
,
BLSY
.
hp
)
print
(
'蔡文姬的生命值为'
,
CVJ
.
hp
)
print
(
'澜的生命值为'
,
lan
.
hp
)
yase
=
Hero
(
'亚瑟'
,
500
,
35
)
yase
.
upgrade
()
yase
.
upgrade
()
print
(
'亚瑟的升级两次的血量为'
,
yase
.
hp
)
\ 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