Commit 7b9b3247 by BellCodeEditor

save project

parent d6c81a0f
class hero():
def __init__(self,name,level,hp,attack):
self.name = name
self.level = level
self.hp = hp
self.attack = attack
jing = hero("jing",15,21000,10000)
print(jing.name,jing.level,jing.hp,jing.attack)
def up():
jing.level= jing.level + 1
jing.hp= jing.hp + 1000
jing.attack= jing.attack + 100
up()
print(jing.name,jing.level,jing.hp,jing.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