Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
691cc308
authored
Jul 09, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
ac2ea1e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
diy.py
diy.py
View file @
691cc308
class
yingxiong
:
class
yingxiong
(
object
)
:
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
self
.
exp
=
1
self
.
exp
=
1
self
.
name
=
name
self
.
name
=
name
self
.
hp
=
300
self
.
hp
=
300
self
.
kun
=
50
self
.
kun
=
50
self
.
hp_max
=
self
.
hp
def
xue
(
self
):
self
.
hp
+
self
.
hp
+
70
if
self
.
hp
>
self
.
hp
def
ji
(
self
,
fyb
):
def
ji
(
self
,
fyb
):
j
=
self
.
kun
j
=
self
.
kun
fyb
.
hp
=
fyb
.
hp
-
j
fyb
.
hp
=
fyb
.
hp
-
self
.
kun
if
fyb
.
hp
>
0
:
if
fyb
.
hp
>
0
:
f
=
fyb
.
name
+
'扣'
+
str
(
j
)
+
'血,剩'
+
str
(
fyb
.
hp
)
+
'血'
f
=
fyb
.
name
+
'扣'
+
str
(
j
)
+
'血,剩'
+
str
(
fyb
.
hp
)
+
'血'
else
:
else
:
f
=
fyb
.
name
+
'嗝屁'
f
=
fyb
.
name
+
'嗝屁'
print
(
f
)
print
(
f
)
yase
=
yingxiong
(
'亚瑟'
)
exit
()
fianyibo
=
yingxiong
(
'范家鸡'
)
class
shishi
(
yingxiong
):
yase
.
ji
(
fianyibo
)
def
__init__
(
self
,
name
,
hero_su
):
\ No newline at end of file
super
(
shishi
,
self
)
.
__init__
(
name
)
self
.
hp
=
200
self
.
kun
=
60
self
.
hero_su
=
hero_su
print
(
'当前角色姓名、血量、等级、攻击力为'
,
self
.
name
,
self
.
hp
,
self
.
exp
,
self
.
kun
)
fianyibo
=
shishi
(
'范家鸡'
,
'鸡'
)
yase
=
yingxiong
(
'亚瑟'
)
\ 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