Commit 893abb7d by BellCodeEditor

save project

parent fb6d3e7c
Showing with 4 additions and 18 deletions
class Hero: j=3
def _init_(self,name,hp,attack) i=5
self.level=1 print(j,'*',i,'=',(j*i))
self.name=name \ No newline at end of file
self.hp=hp
self.attack=attack
def upgrade(self):
yese.level=yese.level+1
yese.hp=yese.hp+50
yese.attack=yese.attack+4
houyi=Hero("后羿",240,23)
houyi.upgrade()
print(houyi.level)
print(houyi.hp)
print(houyi.attack)
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