Commit 9bd29314 by BellCodeEditor

save project

parent 22354288
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attact):
self.hp=300
self.level=1
self.attact=20
self.color='red'
def upgrade(self):
self.level+=1
self.hp+=50
self.attact+=4
def test_hero(self):
print('test_hero')
yase=Hero('yase',300,50)
print(yase.hp)
yase.test_hero()
yase.upgrade()
print(yase.hp)
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