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
db8a61bd
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
be7ff570
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
diy.py
diy.py
View file @
db8a61bd
class
Hero
:
class
Hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
level
=
1
self
.
hp
=
hp
self
.
hp
=
hp
self
.
attack
=
attack
self
.
attack
=
attack
self
.
name
=
name
self
.
name
=
name
...
@@ -8,3 +9,9 @@ ys=Hero('ys',300,25)
...
@@ -8,3 +9,9 @@ ys=Hero('ys',300,25)
hy
=
Hero
(
'hy'
,
250
,
30
)
hy
=
Hero
(
'hy'
,
250
,
30
)
print
(
ys
.
name
)
print
(
ys
.
name
)
print
(
hy
.
name
)
print
(
hy
.
name
)
def
a
():
ys
.
level
=
ys
.
level
+
1
ys
.
hp
=
ys
.
hp
+
50
ys
.
attack
=
ys
.
attack
+
20
a
()
print
(
ys
.
hp
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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