Commit ba0d793c by BellCodeEditor

save project

parent e2998b3b
Showing with 6 additions and 6 deletions
......@@ -4,14 +4,14 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
self.level=Huaqiang.level+1
def upgrade(self):
self.level=self.level+1
self.hp*=11
self.attack*=11
#Zhangsan=Hero('张三',9999999,9999)
#upgrade()
Zhangsan=Hero('张三',9999999,9999)
Zhangsan.upgrade()
Huaqiang=Hero('华强',9999999,9999)
upgrade(self)
Huaqiang.upgrade()
print('华强的hp为:9999999'+str(Huaqiang.hp))
#print('张三的hp为:9999999'+str(Zhangsan.hp))
print('张三的hp为:9999999'+str(Zhangsan.hp))
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