Commit 3621ac50 by BellCodeEditor

save project

parent 22354288
Showing with 33 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def up(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+1
yase=Hero('yase',1000,999999999999999999999999999999)
hy=Hero('hy',2,0)
k=Hero('K',56,1)
yase.up()
# def yaseup():
# yase.level=yase.level+1
# yase.hp=yase.hp+50
# yase.attack=yase.attack+1
# def hyup():
# hy.level=hy.level+1
# hy.hp=hy.hp+50
# hy.attack=hy.attack+1
# def kup():
# k.level=k.level+1
# k.hp=k.hp+50
# k.attack=k.attack+1
# yaseup()
# hyup()
# kup()
print(yase.attack)
print(hy.attack)
print(k.attack)
\ 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