Commit e3ea924f by BellCodeEditor

save project

parent 22354288
Showing with 16 additions and 0 deletions
class Hero:
def __init__(self,m,hp,ad):
self.l=1
self.m=m
self.hp=hp
self.ad=ad
def upgrade(self):
self.l=self.l+1
self.hp=self.hp+100
self.ad=self.ad+7
ya=Hero("ya",500,30)
ya.upgrade()
print("ya",ya.ad)
print("ya",ya.hp)
\ 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