Commit 1fa1c884 by BellCodeEditor

save project

parent e39cc9b3
Showing with 7 additions and 9 deletions
class xinxiong: class xinxiong:
def __init__(self): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=1000 self.hp=hp
self.attack=10 self.attack=10
self.jinyan=0 self.name=name
libai = hero() gongben = xinxiong("宫本"1000,20)
print(libai.level) libai = xinxiong("李白",700,20)
print(libai.hp) print("宫血:",gongben,hp)
print(libai.attack) print("李血:",libaihp)
print(libai.jinyan)
\ 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