Commit 8ba4f0be by BellCodeEditor

save project

parent 218244e0
Showing with 5 additions and 3 deletions
...@@ -2,13 +2,13 @@ class Hero(): ...@@ -2,13 +2,13 @@ class Hero():
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=hp self.hp=hp
self.attact=attack self.attack=attack
self.name=name self.name=name
yasi=Hero("yasi",3000,389) yasi=Hero("yasi",3000,389)
houyi=Hero("houyi",2500,585) houyi=Hero("houyi",2500,585)
print(yasi.hp)
print(houyi.hp) # print(houyi.hp)
def upgrade(): def upgrade():
yasi.level+=1 yasi.level+=1
...@@ -16,3 +16,4 @@ def upgrade(): ...@@ -16,3 +16,4 @@ def upgrade():
yasi.attack+=79 yasi.attack+=79
upgrade() upgrade()
upgrade() upgrade()
print(yasi.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