Commit 8427c228 by BellCodeEditor

save project

parent f47689a4
Showing with 28 additions and 0 deletions
class Hero:
def __init__(self1):
#属性
self1.name='亚瑟'
self1.level = 1
self1.hp=300
self1.attack=20
#方法
def __init__(self2):
self2.level1=0
self2.name1="赵云"
self2.hp1=300
self2.attack1=100
def move():
pass
def speak():
pass
赵云 = Hero()
print(赵云.level1)
print(赵云.hp1)
print(赵云.attack1)
亚瑟 = Hero()
print(亚瑟.level)
print(亚瑟.hp)
print(亚瑟.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