Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_test2
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
fc9a4ace
authored
Jul 17, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a721ce8f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
.py
diy2-test.py
。.py
.py
0 → 100644
View file @
fc9a4ace
diy2-test.py
View file @
fc9a4ace
...
@@ -4,7 +4,7 @@ class Dog: # 狗类
...
@@ -4,7 +4,7 @@ class Dog: # 狗类
self
.
eyeNum
=
2
# 眼睛
self
.
eyeNum
=
2
# 眼睛
self
.
head
=
1
# 头
self
.
head
=
1
# 头
self
.
earsNum
=
2
# 耳朵
self
.
earsNum
=
2
# 耳朵
self
.
skin
=
"
white
"
self
.
skin
=
"
白
"
def
run
(
self
):
def
run
(
self
):
print
(
"狗狗飞快的跑起来"
)
print
(
"狗狗飞快的跑起来"
)
...
@@ -13,8 +13,8 @@ class Dog: # 狗类
...
@@ -13,8 +13,8 @@ class Dog: # 狗类
class
Husky
(
Dog
):
# 哈士奇类
class
Husky
(
Dog
):
# 哈士奇类
def
__init__
(
self
):
def
__init__
(
self
):
super
()
.
__init__
()
super
()
.
__init__
()
self
.
skin
=
"black"
self
.
skin
=
"黑"
print
(
"小狗coco创建成功,它是"
+
coco
.
size
+
"的"
)
print
(
"coco是"
+
coco
.
skin
+
"色的,它有"
+
str
(
coco
.
footNum
)
+
"条腿,"
+
str
(
coco
.
eyeNum
)
+
"个眼睛"
+
str
(
coco
.
head
)
+
"个头,"
+
str
(
coco
.
earsNum
)
+
"个耳朵,它的体型很"
+
coco
.
size
)
print
(
coco
.
run
())
coco
=
Husky
()
coco
=
Husky
()
\ No newline at end of file
print
(
"coco是"
+
coco
.
skin
+
"色的,它有"
+
str
(
coco
.
footNum
)
+
"条腿,"
+
str
(
coco
.
eyeNum
)
+
"个眼睛"
+
str
(
coco
.
head
)
+
"个头,"
+
str
(
coco
.
earsNum
)
+
"个耳朵"
)
print
(
coco
.
run
())
\ No newline at end of file
。.py
View file @
fc9a4ace
This diff is collapsed.
Click to expand it.
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