Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_4
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
2d719325
authored
Jan 27, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
008706d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
ghfghjyghyu.py
xsssdededwewe.py
ghfghjyghyu.py
0 → 100644
View file @
2d719325
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
xsssdededwewe.py
0 → 100644
View file @
2d719325
class
Hero
:
def
__init__
(
self
,
name
)
self
.
level
=
1
self
.
hp
=
250
self
.
attack
=
40
self
.
name
=
name
def
combat
(
self
,
enemy
)
info1
=
self
.
name
+
"对"
+
evemy
+
"发起攻击"
info2
=
"造成"
+
str
(
self
.
attack
)
+
"伤害"
enemy
.
hp
-=
self
.
attack
if
enemy
.
hp
>
0
:
info3
=
enemy
.
name
+
"剩下"
+
str
(
enemy
.
hp
)
+
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