Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson12-2
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
07fc7ca2
authored
Oct 16, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
34a452b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
diy.py
diy.py
View file @
07fc7ca2
class
hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
level
=
1
self
.
name
=
name
self
.
hp
=
hp
self
.
attack
=
attack
def
upgrade
():
ys
.
level
=
ys
.
level
+
1
ys
.
hp
=
ys
.
hp
+
50
ys
.
attack
=
ys
+
10
file_sum
ys
=
hero
(
"ys"
,
300
,
20
)
fot
i
in
a
print
(
"ys的初始血量为:"
,
ys
.
hp
)
data
=
i
.
split
upgarde
()
str
=
0
upgarde
()
for
sales
in
data
[
1
:]
print
(
"ys升级二次后血量为:"
,
ys
.
hp
)
sum
=
sum
+
int
(
sales
)
reilt
=
data
[
0
:]
+
str
(
sun
)
+
file_sum
print
(
reilt
)
file
writelens
(
file_sum
)
\ 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