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
c2114af6
authored
Sep 11, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ca9bce02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
diy.py
jichengdaima.py
diy.py
deleted
100644 → 0
View file @
ca9bce02
class
hero
:
def
__init__
(
self
,
name
,
hp
,
attack
,
level
):
self
.
attack
=
attack
self
.
hp
=
hp
self
.
level
=
level
self
.
name
=
name
Arthur
=
hero
(
"Arthur"
,
300
,
20
,
1
)
Yi
=
hero
(
"Yi"
,
250
,
23
,
1
)
print
(
Arthur
.
hp
)
print
(
Arthur
.
attack
)
print
(
Arthur
.
level
)
print
(
Yi
.
hp
)
print
(
Yi
.
attack
)
print
(
Yi
.
level
)
\ No newline at end of file
jichengdaima.py
0 → 100644
View file @
c2114af6
class
hero
:
def_init_
(
Arthur
,
name
,
hp
,
atk
,
level
):
Arthur
.
name
=
name
Arthur
.
hp
=
hp
Arthur
.
atk
=
atk
Arthur
.
level
=
level
Arthur
=
hero
(
"Arthur"
,
2000
,
200
,
1
)
def
upgrade
():
Arthur
.
hp
=
Arthur
.
hp
+
200
Arthur
.
atk
=
Arthur
.
atk
+
50
Arthur
.
level
=
Arthur
.
level
+
1
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