Commit f26ad26b by BellCodeEditor

save project

parent 9be0a9b7
Showing with 4 additions and 8 deletions
......@@ -8,10 +8,6 @@ class Hero:
self.attack=self.attack+4
self.hp=self.hp+50
self.level=self.level+1
yase=Hero('雅瑟',300,20)
#hy=Hero('后裔',240,23)
#zjm=Hero('粥加明',500,10)
yase.upgrade()
print(yase.hp)
print(yase.attack)
print(yase.level)
\ No newline at end of file
xiaobei=Hero("小贝",500,50)
xiaobei.upgrade()
print("小贝的等级为",xiaobei.level,"小贝的攻击力为",xiaobei.attack,"小贝的生命为",xiaobei.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