Commit 2a2ec41a by BellCodeEditor

save project

parent 22354288
Showing with 18 additions and 0 deletions
class Hero:
def_init_(name,hp,attack):
self.level=1
self.neme=nema
self.hp=hp
self.attack
yase = Hero("啞瑟"30020)
houye =Hero("后羿"25023)
def upgrade():
yase.level=yeas.level+1
yase.hp=yase.hp=hp+50
yase.attack=yase.attack+4
upgrade()
upgrade()
houyi = Hero("后羿"24023)
houyi.upgrade()
print("等級為1"houyi.)
\ 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