Commit b989d471 by BellCodeEditor

save project

parent b14be3fc
Showing with 13 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=300
self.attack=attack
hanxin=Hero("韩信",500,50)
kai=Hero("凯",500,50)
print("韩信的血量为:",hanxin.hp)
print("韩信的攻击为:",hanxin.attack)
print("凯的血量为:",kai.hp)
print("凯的攻击为:",kai.attack)
\ 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