Commit d6579854 by BellCodeEditor

save project

parent bcf7c414
Showing with 7 additions and 5 deletions
......@@ -2,11 +2,12 @@ class Hero:
def __init__(self,name,hp,attack):
self.hp = 100
self.attack = 100
def up():
a.hp=a.hp+20
a.attack=a.attack+20
a = Hero("三木",100,100)
b = Hero("漆世强",30,200)
print("三木的血量为:",a.hp)
print("漆世强的血量为:",b.hp)
print("三木的属性为:",a.hp,a.attack)
up()
print("三木的升级后的属性为:",a.hp,a.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