Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-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
602175e2
authored
Aug 27, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
cc376ebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
diy.py
diy.py
View file @
602175e2
class
hero
:
def
__init__
(
self
,
name
,
hp
,
attaack
):
self
.
level
=
1
self
.
hp
=
hp
self
.
attaack
=
attaack
def
uphero
(
self
):
self
.
level
+=
1
self
.
hp
+=
400
self
.
attaack
+=
100
neigui
=
hero
(
'内鬼'
,
100
,
1000
)
shehunguai
=
hero
(
'摄魂怪'
,
1000
,
1000
)
print
(
'内鬼的生命'
,
neigui
.
hp
)
print
(
'内鬼的等级'
,
neigui
.
level
)
print
(
'摄魂怪的生命'
,
shehunguai
.
hp
)
print
(
'摄魂怪的等级'
,
shehunguai
.
level
)
\ 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