Commit af63f1b3 by BellCodeEditor

save project

parent 0d68f44a
Showing with 8 additions and 4 deletions
class Hero: class Hero:
def _init_(self) def _init_(self,name,hp,attack)
self.level=1 self.level=1
self.hp=300 self.name=name
self.attack=20 self.hp=hp
yese=Hero() self.attack=attack
yese=Hero("亞瑟",300,20)
houyi=Hero("后羿",240,23)
print(houyi.hp)
print(yese.hp) print(yese.hp)
\ 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