Commit 5f244abc by BellCodeEditor

save project

parent 6b1a3564
Showing with 29 additions and 5 deletions
......@@ -3,9 +3,33 @@ class hero:
self.name=name
self.level=1
self.hp=hp
self.attack=attack
yao = hero("耀",3000,600)
self.attack=attack
yao = hero("耀",3000,600)
print("耀的血量为:",yao.hp)
print("耀的等级为:",yao.level)
print("耀的攻击为:",yao.attack)
\ No newline at end of file
print("耀的攻击为:",yao.attack)
def up(self):
self.hp=self.hp+500
self.level=self.level+1
self.attack=self.attack+100
yao.up()
print("耀的属性发生了变化!")
print("耀的血量为:",yao.hp)
print("耀的等级为:",yao.level)
print("耀的攻击为:",yao.attack)
yao.up()
print("耀的属性发生了变化!")
print("耀的血量为:",yao.hp)
print("耀的等级为:",yao.level)
print("耀的攻击为:",yao.attack)
yao.up()
print("耀的属性发生了变化!")
print("耀的血量为:",yao.hp)
print("耀的等级为:",yao.level)
print("耀的攻击为:",yao.attack)
yao.up()
print("耀的属性发生了变化!")
print("耀的血量为:",yao.hp)
print("耀的等级为:",yao.level)
print("耀的攻击为:",yao.attack)
yao.up()
\ 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