Commit be7ff570 by BellCodeEditor

save project

parent 779a906e
Showing with 10 additions and 6 deletions
class Hero:
def __init__(self):
self.hp=300
self.attack=60
ys=Hero()
print(ys.attack)
\ No newline at end of file
def __init__(self,name,hp,attack):
self.hp=hp
self.attack=attack
self.name=name
ys=Hero('ys',300,25)
hy=Hero('hy',250,30)
print(ys.name)
print(hy.name)
\ 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