Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_3
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
0544c1ce
authored
Oct 06, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
0ad77f6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
diy2.py
diy2.py
View file @
0544c1ce
...
@@ -4,7 +4,13 @@ class Hero:
...
@@ -4,7 +4,13 @@ class Hero:
self
.
name
=
name
self
.
name
=
name
self
.
hp
=
hp
self
.
hp
=
hp
self
.
attack
=
attack
self
.
attack
=
attack
yase
=
Hero
(
'亚瑟'
,
300
,
20
)
def
up1
(
self
):
houyi
=
Hero
(
'后羿'
,
240
,
23
)
self
.
level
=
self
.
level
+
1
print
(
"亚瑟的血量为:"
,
yase
.
hp
)
self
.
hp
=
self
.
hp
+
100
print
(
"后羿的血量为:"
,
houyi
.
hp
)
self
.
attack
=
self
.
attack
+
10
yase
=
Hero
(
'末影龙'
,
200
,
15
)
houyi
=
Hero
(
'凋灵'
,
600
,
12
)
yase
.
up1
()
print
(
"末影龙的血量为:"
,
yase
.
hp
)
print
(
"末影龙的攻击为:"
,
yase
.
attack
)
print
(
"末影龙的等级为:"
,
yase
.
level
)
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