Commit dbcf3afd by BellCodeEditor

save project

parent 6f34fe20
Showing with 14 additions and 6 deletions
...@@ -5,8 +5,17 @@ class Teacher: ...@@ -5,8 +5,17 @@ class Teacher:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.tall=tall self.tall=tall
xiaoliu=Teacher('xiaoliu',10000,2000,165) def upgrade(self):
laoyu=Teacher('laoyu',999,80,170) self.level=self.level+1
daxingxing=Teacher('daxingxing',1000,0.001,160) self.hp=self.hp+50
duangongchang=Teacher('duangongchang',9090,5,0.0000000001) self.attack=self.attack+10
print(laoyu.hp) xiaoliu=Teacher('小榴',10000,2000,165)
\ No newline at end of file laoyu=Teacher('老于',999,80,170)
daxingxing=Teacher('大猩猩',1000,0.001,160)
xiaoluban=Teacher('小鲁班',9090,5,0.0000000001)
xiaoliu.upgrade()
laouyu.upgrade()
daxingxing.upgrade()
xiaoluban.upgrade()
print(xiaoliu.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