Commit e0383e45 by BellCodeEditor

save project

parent 20fc69a7
Showing with 12 additions and 10 deletions
...@@ -4,13 +4,16 @@ class A: ...@@ -4,13 +4,16 @@ class A:
self.level=level self.level=level
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
b=A("nrt",1,300,6)
def a():
b.level=b.level+1 def a(self):
b.hp=b.hp+200 self.level=self.level+1
b.attack=b.attack+200 self.hp=self.hp+200
print(b.level) self.attack=self.attack+200
a() a=A(1,2,3,4)
a() print(a.attack)
\ No newline at end of file a.a()
print(a.attack)
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