Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
a0ccb805
authored
May 20, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
40ea9dd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
diy2.py
diy2.py
View file @
a0ccb805
...
@@ -6,13 +6,14 @@ class Hero:
...
@@ -6,13 +6,14 @@ class Hero:
self
.
attack
=
attack
self
.
attack
=
attack
def
upgrade
():
def
upgrade
():
ganjing
.
level
=
ganjing
.
level
+
1
ganjing
.
level
=
ganjing
.
level
+
1
ganjing
.
hp
=
ganjing
.
hp
+
10
ganjing
.
attack
=
ganjing
.
attack
+
10
ganjing
=
Hero
(
'赶紧'
,
20
,
1000
)
ganjing
=
Hero
(
'赶紧'
,
20
,
1000
)
shandiao
=
Hero
(
'删掉'
,
2000
,
1
)
shandiao
=
Hero
(
'删掉'
,
2000
,
1
)
#print('ganjing Hp:',ganjing.hp)
#print('ganjing Hp:',ganjing.hp)
#print('ganjing attack:',ganjing.attack)
#print('ganjing attack:',ganjing.attack)
#print('shandiao Hp:',shandiao.hp)
#print('shandiao Hp:',shandiao.hp)
#print('shandiao attack:',shandiao.attack)
#print('shandiao attack:',shandiao.attack)
print
(
'赶紧的初始血量为:'
,
ganjing
.
level
)
print
(
'赶紧的初始血量为:'
,
ganjing
.
hp
)
upgrade
()
upgrade
()
print
(
'升级一次后的血量为:'
,
ganjing
.
level
)
print
(
'升级一次后的血量为:'
,
ganjing
.
hp
)
\ No newline at end of file
\ 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