Commit 25d15a72 by BellCodeEditor

save project

parent 424a90d9
Showing with 7 additions and 0 deletions
......@@ -7,3 +7,9 @@ class Hero:#定义一个类名
zhaoyun=Hero(350,785,232,"赵云")#类的实例
sunshangxiang=Hero(365,684,324,"孙尚香")
print(zhaoyun.hp,zhaoyun.name)#打印赵云的攻击力
def sj():
sunshangxiang.hp+=200
sunshangxiang.attack+=100
sunshangxiang.fangyu+=54
sj()
print(sunshangxiang.hp,sunshangxiang.name)
\ 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