Commit 05d97af3 by BellCodeEditor

save project

parent 8c8ad93a
Showing with 9 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=300 self.name=name
self.attack=20 self.hp=hp
yase=Hero() self.attack=attack
print(yase.hp) yase=Hero("阿尔法",4000,9500)
\ No newline at end of file den=Hero('盾山',10000,2000)
print("阿尔法的攻击:",yase.attack)
print("盾山的攻击:",den.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