Commit 5e9f320d by BellCodeEditor

save project

parent e26eea4a
Showing with 10 additions and 4 deletions
...@@ -5,6 +5,13 @@ class Hero(): ...@@ -5,6 +5,13 @@ class Hero():
self.HP=HP self.HP=HP
self.a=a self.a=a
sb=Hero('sans',1,1) sb=Hero('sans',1,1)
ab=Hero('sanswd',1,1) def sd_up()
print('sans的HP',sb.HP) sb.Lv=sb.Lv+1
print('sanswd的HP',ab.HP) sb.HP=sb.HP+0
\ No newline at end of file sb.a=sb.a=0
print("初始Lv为",sb.Lv)
sb_up()
sb_up()
sb_up()
print("升级后Lv为",sb.Lv)
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