Commit e4a4c226 by BellCodeEditor

save project

parent 19ebc1a0
Showing with 6 additions and 2 deletions
...@@ -4,5 +4,10 @@ class Teacher: ...@@ -4,5 +4,10 @@ class Teacher:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade():
xiaoni.hp=xiaoni.hp+50
xiaoni.attack=xiaoni.attack+4
xiaoni=Teacher("小倪",1000,30) xiaoni=Teacher("小倪",1000,30)
print("小倪的血量:",xiaoni.hp) print("小倪HP:",xiaoni.hp)
\ No newline at end of file upgrade()
print("升級后HP:",xiaoni.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