Commit 5bdf3a88 by BellCodeEditor

save project

parent e6adea03
Showing with 12 additions and 12 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): ciass Hero:
self.level=1 def _init_(self,name,hp,attack):
self.name=name self.level = 1
self.hp=hp self.name = name
self.attack=attack self.hp= hp
yase=Hero('yase',300,20) self.attack= attack
hy=Hero('hy',250,23)
k=Hero('K',5600,199) yase = Hero("a",300,20)
print(yase.attack) houyi = hero("b",240,23)
print(hy.attack) print("yase为:",yase.hp)
print(k.attack) print("yase为:",houyi.hp)
\ 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