Commit 6b5f933d by BellCodeEditor

save project

parent 9a2e7e4e
Showing with 17 additions and 5 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,level,hp,attack):
self.level = 1 self.level = level
self.hp = 300 self.hp = hp
self.attack = 20 self.attack = attack
zhiyin = Hero() zhiyin = Hero("zhiyin",1.145141919810,1145141919810,1145141919810)
ji = Hero("ji",1.145141919810,1145141919810,1145141919810)
kunkun = Hero("kunkun",1.145141919810,1145141919810,1145141919810)
caixukun = Hero("kunkun",1.145141919810,1145141919810,1145141919810)
print(zhiyin.level) print(zhiyin.level)
print(zhiyin.hp) print(zhiyin.hp)
print(zhiyin.attack) print(zhiyin.attack)
print(ji.level)
print(ji.hp)
print(ji.attack)
print(kunkun.level)
print(kunkun.hp)
print(kunkun.attack)
print(caixukun.level)
print(caixukun.hp)
print(caixukun.attack)
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