Commit b98cf65d by BellCodeEditor

save project

parent dcc467cb
Showing with 10 additions and 9 deletions
class Hero_1:
def __init__(self):
class Hero:
def __init__(self,name,shengming,gongji):
self.dj = 1
self.shm = 300
self.gj = 20
self.mz = name
self.shm = shengming
self.gj = gongji
yase = Hero_1()
print(yase.shm)
\ No newline at end of file
yase = Hero("亚瑟",300,20)
huoqubing = Hero("霍去病",100,250)
xiangyu = Hero("项羽",200,150)
print(huoqubing.shm)
\ 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