Commit efa6162a by BellCodeEditor

save project

parent 500e2674
Showing with 8 additions and 6 deletions
class Hero:
def __int__(self):
def __int__(self,name,hp,attack):
self.level= 1
self.hp = 300
self.attack = 20
self.name=name
self.hp =hp
self.attack = attack
huamulan = Hero()
print("huamulan的血量是:",huamulan.hp)
print("huamulan的攻擊力為: ",huamulan.attack)
\ No newline at end of file
houyi = Hero()
print("huamulan",300,50)
print("houyi ",250,70)
\ 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