Commit 64c28df3 by BellCodeEditor

auto save

parent 16e88b09
Showing with 12 additions and 8 deletions
class Hero:
def __init__(self):
def __init__(self,hp,attack):
self.level=1
self.hp=300
self.attack=40
yase=Hero()
print(yase.level)
print(yase.hp)
print(yase.attack)
\ No newline at end of file
self.hp=hp
self.attack=attack
yase=Hero(200,40)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+5
upgrade()
upgrade()
print(yase.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