Commit e2b9f066 by BellCodeEditor

save project

parent 8d915629
Showing with 9 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.hp=1000 self.name=name
self.attack=10000 self.hp=hp
self.attack=attack
self.level=1 self.level=1
aoteman=Hero() aoteman=Hero('aoteman',100,10000)
print(aoteman.hp) dijia=Hero('dijia',99,1000000000000)
\ No newline at end of file print("奥特曼的血量为",aoteman.hp)
print("迪迦的血量为",dijia.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