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
1a7f5ab5
authored
Mar 13, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
8ffa2f86
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
1.py
diy.py
1.py
0 → 100644
View file @
1a7f5ab5
This diff is collapsed.
Click to expand it.
diy.py
View file @
1a7f5ab5
class
Hero
:
def
__init__
(
self
):
self
.
leve
=
1
self
.
hp
=
4000
self
.
attack
=
180
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
level
=
1
self
.
name
=
name
self
.
hp
=
hp
self
.
attack
=
attack
yase
=
Hero
()
def
sj
():
yase
.
hp
+=
175
yase
.
level
+=
1
yase
.
attack
+=
129
yase
=
Hero
(
"亞瑟"
,
4536
,
180
)
houyi
=
Hero
(
"後羿"
,
2981
,
217
)
sj
()
print
(
yase
.
hp
)
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