Commit 82390b88 by BellCodeEditor

save project

parent 22354288
Showing with 12 additions and 0 deletions
class Heros:
def __init__(self,name,attack,hp):
self.name=name
self.level=1
self.attack=attack
self.hp=hp
def updata(self):
self.hp+=50
yase=Heros("亞瑟",27,300)
yase.updata()
print(yase.name+"的hp:"+str(yase.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