Commit 9763bcfe by BellCodeEditor

save project

parent 22354288
Showing with 29 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack,hs):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
self.hs=hs
def upgrade(self):
self.level+=2
self.hp+=100
self.attack+=999
self.hs+=100000000
# alex=Hero('alex',250,23)
# woc=Hero('woc',99999999,999)
# print(self.attack)
# print(alex.attack)
# print(woc.attack)
steve=Hero('steve',300,20,1)
while steve.level<1000:
steve.upgrade()
print(steve.attack)
print(steve.hs)
print(steve.hp)
print(steve.level)
\ 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