Commit 105f85b3 by BellCodeEditor

save project

parent e70a29d4
Showing with 3 additions and 2 deletions
...@@ -2,10 +2,10 @@ class Hero: ...@@ -2,10 +2,10 @@ class Hero:
def __init__(self, name, hp, attack): def __init__(self, name, hp, attack):
self.level = 1 self.level = 1
self.name = name self.name = name
self.name = hp self.hp = hp
self.attack = attack self.attack = attack
yase = Hero("后羿",40000,50000) yase = Hero("后羿",40000,50000)
houyi = Hero("妲己",0.1,1) houyi = Hero("妲己",40000,1)
print("后羿的血量为:",yase.hp) print("后羿的血量为:",yase.hp)
print("妲己的血量为:",yase.hp) print("妲己的血量为:",yase.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