Commit b8d31ef1 by BellCodeEditor

save project

parent ae20c1e4
Showing with 7 additions and 5 deletions
...@@ -4,11 +4,12 @@ class Hero: ...@@ -4,11 +4,12 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
y=Hero('yase',300,20) def up(q):
def up(): q.level+=1
y.level+=1 q.hp+=50
y.hp+=50 q.attack+=5
y.attack+=5 y=Hero('toi',300,20)
print(y.attack) print(y.attack)
up() up()
print(y.attack) print(y.attack)
\ 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