Commit c04e7ce8 by BellCodeEditor

auto save

parent ace802a5
Showing with 7 additions and 13 deletions
class Hero: for i in range(1,10):
def __init__(self,name,hp,attack): for jj in range(1,i+1):
self.level=1 print(i,"*",jj,"=",i*jj,end=" ")
self.hp=hp print()
self.attack=attack
self.name=name
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+1
self.attack=self.attack+1
yase=Hero("牙色",300,20)
yase.upgrade()
print(yase)
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