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

bellcode / lesson12-4

  • 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
Switch branch/tag
  • lesson12-4
  • 3.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 7070371a
    BellCodeEditor committed 3 years ago
    7070371a
3.py 363 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class Hero():
    def __init__(self,name,hp,attack,level):
        self.name=name
        self.level=level
        self.hp=hp
        self.attack=attack
yase=Hero("垭瑟",300,20,1)
houyi=Hero("后羿",250,23,1)
print(yase.hp)
def Up_level():
    yase.level=yase.level+1
    yase.hp=yase.hp+50
    yase.attack=yase.attack+4
Up_level()
print(yase.hp)