Commit 62531144 by BellCodeEditor

save project

parent 30dbd9be
Showing with 5 additions and 5 deletions
...@@ -2,9 +2,9 @@ class Hero: ...@@ -2,9 +2,9 @@ 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.hp = up self.hp = hp
self.attack = attack self.attack = attack
laoba = Hero() laoba = Hero("老八",300,50)
jeige = Hero() jeige = Hero("杰哥",500,10)
print("老八的血量:",laoba.hp) print("老八的血量:",laoba.hp)
print("") print("杰哥的血量:",jeige.hp)
\ No newline at end of file \ 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