Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_2_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
2225b0d7
authored
Apr 13, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ce44dbd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletions
11111.py
diy.1py
diy2.py
11111.py
0 → 100644
View file @
2225b0d7
class
Dog
:
def
__init__
(
self
)
self
.
footNum
=
4
self
.
eyeNum
=
2
self
.
earsNum
=
2
self
.
head
=
1
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
diy.1py
0 → 100644
View file @
2225b0d7
class Dog:
def __init__(self)
self.footNum = 4
self.eyeNum = 2
self.earsNum = 2
self.head = 1
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
diy2.py
View file @
2225b0d7
...
@@ -29,4 +29,4 @@ class Player(): # 玩家英雄
...
@@ -29,4 +29,4 @@ class Player(): # 玩家英雄
player
=
Player
(
"后羿"
)
player
=
Player
(
"后羿"
)
print
(
"玩家的血量值为:"
,
player
.
hp
)
print
(
"玩家的血量值为:"
,
player
.
hp
)
print
(
"玩家的攻击力为:"
,
player
.
attack
)
print
(
"玩家的攻击力为:"
,
player
.
attack
)
\ 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