Commit 12c26613 by BellCodeEditor

save project

parent 3c738dba
Showing with 20 additions and 0 deletions
class Meme:
def __init__(self,name,hp,level,defense,attack,ability):
self.name=name
self.hp=hp
self.level=level
self.defense=defense
self.attack=attack
self.ability=ability
def upgrade(self):
self.hp=self.hp*2
self.level=self.level+1
self.attack=self.attack*2
self.defense=self.defense*2
xianbei=Meme("先辈",114514,114514,114514,114514,"昏睡红茶")
xianbei.upgrade()
print(xianbei.hp)
print(xianbei.attack)
print(xianbei.level)
print(xianbei.defense)
\ 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