Commit bd4c1b09 by BellCodeEditor

save project

parent a59bd513
Showing with 13 additions and 5 deletions
class Hero: class Hero:
def __init__ (self,hp,attack): def __init__ (self,hp,attack):
self.level=999 self.level=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero(999999999999999999,999999999999999999) def upgrade(self):
self.level=self.level+1
self.hp=self.hp+1
self.attack=self.attack+1
yase=Hero(300,50)
yase.upgrade()
yase.upgrade()
print(yase.hp) print(yase.hp)
hoyi=Hero(888888888888888888,888888888888888888) print(yase.attack)
print(hoyi.attack)
\ No newline at end of file houyi=Hero(200,60)
houyi.upgrade()
print(houyi.attack)
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