Commit 893abb7d by BellCodeEditor

save project

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