Commit 85d3d378 by BellCodeEditor

save project

parent 3aa00b2f
Showing with 9 additions and 4 deletions
...@@ -4,7 +4,12 @@ class Hero: ...@@ -4,7 +4,12 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
dream=Hero("dream",1,10000) def levelup(name):
sub=Hero("sub",100000,0) name.level+=1
name.hp*=1.2
name.attack+=20
dream=Hero("dream",300,100)
levelup(dream)
sub=Hero("sub",260,120)
print(dream.hp) print(dream.hp)
print(sub.attack) print(dream.attack)
\ 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