Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_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
fbe37ae5
authored
Apr 22, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a6e329ea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
diy1.py
dkdsl.py
diy1.py
View file @
fbe37ae5
...
@@ -14,3 +14,16 @@ class Cat:
...
@@ -14,3 +14,16 @@ class Cat:
role
=
Cat
()
role
=
Cat
()
role
.
skill
(
'老鼠'
)
role
.
skill
(
'老鼠'
)
class
Player
(
Hero
):
def
__init__
(
self
,
name
,
hero_type
):
super
(
player
,
self
)
.
__init__
(
name
)
self
.
hp
=
200
self
.
attack
=
50
self
.
hero_type
=
hero_type
print
(
'博客'
+
self
.
name
+
'走在叶虫,捉虫校园生活:'
,
self
.
hero_type
)
print
(
'可就不好你看建成开放活动:'
,
self
.
level
,
self
.
hp
,
self
.
attack
)
houyi
=
Player
(
'后羿'
,
'射手'
)
yase
=
Hero
(
'亚瑟'
)
\ No newline at end of file
dkdsl.py
0 → 100644
View file @
fbe37ae5
class
Dog
:
daf
__init__
(
self
):
self
.
footNum
=
4
self
.
eyeNum
=
2
self
.
head
=
1
self
.
earsNum
=
2
self
.
skin
=
'white'
def
run
(
Dog
):
print
(
'狗狗飞快的跑起来'
)
class
Husky
(
Dog
):
def
__init__
(
self
):
super
()
.
__init__
()
self
.
skin
=
'black'
coco
=
Husky
()
print
(
coco
.
skin
)
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