Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson12-1

  • This project
    • Loading...
  • Sign in
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 8cf6cdeb authored a year ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 42ea2805
Show whitespace changes
Inline Side-by-side
Showing with 9 additions and 9 deletions
  • sb.py/2635156.py
sb.py/2635156.py
View file @ 8cf6cdeb
...@@ -5,13 +5,13 @@ class Hero: ...@@ -5,13 +5,13 @@ class Hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade(): def upgrade(self):
xiao.level=xiao.level+10 self.level=self.level+10
xiao.hp=xiao.hp+650 self.hp=self.hp+650
xiao.attack=xiao.attack+780 self.attack=self.attack+780
xiao = Hero("魈",300,20) xiao = Hero("魈",300,20)
print(xiao.hp) xiao.upgrade()
upgrade() print("等级为:",xiao.level)
upgrade() print("血量为:",xiao.hp)
print(xiao.hp) print("攻击为:",xiao.attack)
\ No newline at end of file \ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment