Commit 2ad963df by BellCodeEditor

save project

parent 22354288
Showing with 19 additions and 0 deletions
class Hero():
def __init__(self,HP,attack,level):
self.HP = HP
self.attack = attack
self.level = level
def xo(self):
self.HP=self.HP+100
self.attack=self.attack+100
self.level=self.level+1
yase=Hero(100,100,1)
yase.xo()
yase.xo()
yase.xo()
houyi=Hero(10,1000,1)
houyi.xo()
houyi.xo()
print(yase.attack)
print(houyi.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