Commit d3f1de14 by BellCodeEditor

save project

parent 1e1decb0
Showing with 11 additions and 2 deletions
...@@ -4,7 +4,16 @@ class Hero: ...@@ -4,7 +4,16 @@ class Hero:
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
zcf = Hero("诸葛村夫",666,666)
def ug():
yuanshu.level=yuanshu.level+1
yuanshu.hp=yuanshu.hp-60
yuanshu.attack=yuanshu.attack-200
yuanshu = Hero("猿树",500,0.1) yuanshu = Hero("猿树",500,0.1)
zhugecunfu = Hero("诸葛村夫",666,666)
print("名称:",yuanshu.name,"等级:",yuanshu.level,"血量:",yuanshu.hp,"伤害:",yuanshu.attack) print("名称:",yuanshu.name,"等级:",yuanshu.level,"血量:",yuanshu.hp,"伤害:",yuanshu.attack)
ug()
ug()
ug()
print("升了三次级后, 名称:",yuanshu.name,"等级:",yuanshu.level,"血量:",yuanshu.hp,"伤害:",yuanshu.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