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
f6d14f67
authored
Jul 02, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
f47689a4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
diy.py
diy2.py
diy.py
View file @
f6d14f67
class
Hero
:
#英雄类
def
__init__
(
self
):
self
.
level
=
1
#类属性
self
.
hp
=
1000
self
.
df
=
300
self
.
attack
=
50
houyi
=
Hero
()
#实例化对象
print
(
houyi
.
hp
)
diy2.py
0 → 100644
View file @
f6d14f67
class
Shot
:
def
__init__
(
self
,
name
,
age
,
level
,
skill
):
#形参
self
.
name
=
name
self
.
age
=
age
self
.
level
=
level
self
.
skill
=
skill
hz
=
Shot
(
'黄忠'
,
50
,
20
,
'百步穿杨'
)
ssx
=
Shot
(
'孙尚香'
,
20
,
10
,
'火炮'
)
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