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
602b46c3
authored
Jan 16, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
1e71c359
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
diy.py
diy.py
View file @
602b46c3
...
@@ -3,5 +3,21 @@ class Hero:
...
@@ -3,5 +3,21 @@ class Hero:
self
.
hp
=
hp
self
.
hp
=
hp
self
.
Gj
=
Gj
self
.
Gj
=
Gj
self
.
dj
=
1
self
.
dj
=
1
#houyi=Hero(50,30)
#print(houyi.Gj)
def
shj
(
self
):
self
.
dj
=
self
.
dj
+
1
self
.
Gj
=
self
.
Gj
+
5
self
.
hp
=
self
.
hp
+
10
yase
=
Hero
(
100
,
20
)
yase
=
Hero
(
100
,
20
)
print
(
yase
.
Gj
)
yase
.
shj
()
\ No newline at end of file
print
(
'亚瑟生命值为:'
,
yase
.
hp
)
print
(
'亚瑟攻击值为:'
,
yase
.
Gj
)
print
(
'亚瑟等级为:'
,
yase
.
dj
)
houyi
=
Hero
(
50
,
40
)
houyi
.
shj
()
print
(
'后羿生命值为:'
,
houyi
.
hp
)
print
(
'后羿攻击值为:'
,
houyi
.
Gj
)
print
(
'后羿等级是:'
,
houyi
.
dj
)
\ 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