Commit 1f5805db by BellCodeEditor

save project

parent c3c6bbfe
Showing with 8 additions and 4 deletions
......@@ -6,9 +6,12 @@
#with open(r'C:\Users\Administrator\Documents\lesson13-1\sales_list.txt','a',encoding='utf-8')as file1:
#file1.writelines(final_sum)
class Hero:
def __init__(self):
def __init__(self,name,hp,attack):
self.level=1
self.hp=300
self.attack=30
wukong = Hero()
self.name=name
self.hp=hp
self.attack=attack
wukong = Hero("悟空",200,40)
yase = Hero("亚瑟",300,20)
print(wukong.hp)
print(yase.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