Commit efa6162a by BellCodeEditor

save project

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