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
5a963c0f
authored
Aug 06, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
85222ec0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
diy.py
diy.py
View file @
5a963c0f
...
@@ -10,5 +10,20 @@ haimianbaobao=Hero("海绵宝宝",1,210,20)
...
@@ -10,5 +10,20 @@ haimianbaobao=Hero("海绵宝宝",1,210,20)
print
(
"英雄名称为:"
+
xiaodaidai
.
name
)
print
(
"英雄名称为:"
+
xiaodaidai
.
name
)
print
(
"海绵宝宝的血量是:"
,
haimianbaobao
.
hp
)
print
(
"海绵宝宝的血量是:"
,
haimianbaobao
.
hp
)
def
LevelUp
():
xiaodaidai
.
level
=
xiaodaidai
.
level
+
1
xiaodaidai
.
hp
=
xiaodaidai
.
hp
+
50
xiaodaidai
.
attack
=
xiaodaidai
.
attack
+
100
LevelUp
()
LevelUp
()
LevelUp
()
print
(
"英雄名称为:"
+
xiaodaidai
.
name
)
print
(
"小呆呆的血量是:"
,
xiaodaidai
.
hp
)
print
(
"小呆呆的等级是:"
,
xiaodaidai
.
level
)
print
(
"小呆呆的攻击力是:"
,
xiaodaidai
.
attack
)
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