Commit 2be190b7 by BellCodeEditor

save project

parent 37bd75df
Showing with 10 additions and 7 deletions
class Hero:
def __init__(self):
self.level=100000000000
self.hp=800000
self.attack=56000
ffyhf=Hero()
print(ffyhf.hp)
\ No newline at end of file
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
libai=Hero('李白',500,35)
mengtian=Hero('蒙恬',300,20)
print("李白的血量是",libai.hp)
print("蒙恬的血量是",mengtian.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