Commit 305ace31 by BellCodeEditor

save project

parent 477037cd
Showing with 5 additions and 0 deletions
...@@ -3,6 +3,10 @@ class Hero: ...@@ -3,6 +3,10 @@ class Hero:
self.hp = 300 self.hp = 300
self.level = 1 self.level = 1
self.attact = 20 self.attact = 20
#类方法的局部变量
color = 'red'
#类方法的属性 局部变量不等于雷属性
self.color = color
yase = Hero() yase = Hero()
print(yase.hp) print(yase.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