Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_test1
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
06123e5f
authored
Feb 17, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6fcfcb42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
16 deletions
diy-test1.py
diy-test1.py
View file @
06123e5f
class
Cat
:
def
__init__
(
self
):
self
.
footNum
=
4
self
.
eyeNum
=
2
self
.
head
=
1
self
.
earsNum
=
2
self
.
skin
=
"white"
def
run
(
self
):
print
(
"用谷歌翻译"
)
class
Husky
(
Dog
)
def
__init__
(
self
):
super
()
.
__init__
()
self
.
skin
=
"black"
coco
=
Husky
()
print
(
coco
.
skin
)
\ No newline at end of file
class
player
(
hero
)
def_init_
(
self
,
hero_type
,
name
):
super
()
.
_init_
(
name
)
self
.
hp
=
200
self
.
attack
=
50
self
.
max_hp
=
self
.
hp
print
(
"角色"
+
self
.
name
+
"创建成功,"
)
print
(
ldjvRSHAVOIHSVDHSDAO
[
HDOHSADII
])
houi
=
player
(
"射手"
,
"后羿"
)
yase
=
hero
(
"亚瑟"
)
houyi
.
combat
(
yase
)
yase
.
combat
(
houyi
)
houyi
.
cure
()
yase
.
cure
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