Commit 3136896d by BellCodeEditor

save project

parent 36c22f27
Showing with 7 additions and 7 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level = 1 self.level = 1
self.hp = 99999 self.name = name
self.attack = 99 self.hp = hp
self.attack = attack
laoshi = Hero() laoshi = Hero('老师',99999,100)
banzhuren = Hero('班主任'199999199)
print('老师的血量值为:',laoshi.hp) print('老师的血量值为:',laoshi.hp)
\ No newline at end of file
print('老师的攻击力为:',laoshi.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