Commit 43a039b7 by BellCodeEditor

save project

parent d6c81a0f
Showing with 22 additions and 0 deletions
class Monster:
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
frogy = Monster("frogy",10,2)
flowy = Monster("flowy",20,1)
creeper = Monster("creeper",20,25)
def upgrade(name):
name.level = name.level + 1
name.hp = name.hp + 5
name.attack = name.attack + 2
upgrade(frogy)
print(frogy.level)
print(frogy.hp)
print(frogy.attack)
\ 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