Commit da518eb0 by BellCodeEditor

auto save

parent 22354288
Showing with 15 additions and 0 deletions
class Hero:
def __init__(self,name,LV,hp,atk):
self.name=name
self.LV=LV
self.hp=hp
self.atk=atk
def up(self):
self.LV=self.LV+1
self.hp=self.hp+50
self.atk=self.atk+5
yase=Hero("yase",1,200,20)
yase.up()
print(yase.LV)
print(yase.hp)
print(yase.atk)
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