Commit 294eb441 by BellCodeEditor

save project

parent adc52e7f
Showing with 10 additions and 8 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,hp,attack,speed):
self.level = 1 self.hp = hp
self.hp= 300 self.attack = attack
self.attack= 20 self.speed = speed
yase=Hero() yase=Hero(300,20,1.5)
sangqi=Hero(200,20,2)
kai=Hero(250,100,1.8)
print("亚瑟的血量为",yase.hp) print("亚瑟的血量为",yase.hp)
print("亚瑟的等级为",yase.level) print("凯的攻击力为",kai.attack)
print("亚瑟的攻击力为",yase.attack) print("桑启")
\ No newline at end of file \ 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