Commit db8a61bd by BellCodeEditor

save project

parent be7ff570
Showing with 8 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.hp=hp
self.attack=attack
self.name=name
......@@ -8,3 +9,9 @@ ys=Hero('ys',300,25)
hy=Hero('hy',250,30)
print(ys.name)
print(hy.name)
def a():
ys.level=ys.level+1
ys.hp=ys.hp+50
ys.attack=ys.attack+20
a()
print(ys.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