Commit 9bf3764e by BellCodeEditor

save project

parent 410ea9e2
Showing with 17 additions and 16 deletions
'''s= {'F': 70, 'C': 67, 'H': 104,'I':105,'S':115}
print(s['C'])'''
'''s= {'F': 70, 'C': 67, 'H': 104,'I':105,'S':115}
s['H']=10
s['xh']=11
print(s)'''
'''s={'1':'zpj'}
s['1']='zpj'
s['1']='tsz'
s['2']='jxz'
s['3']='shs'
s['4']='zpj'
print(4)'''
\ No newline at end of file
class Hero:
def __init__(self,name,hp,sttack):
self.level=1
self.name = name
self.hp=hp
self.sttack=sttack
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+1
self.sttack=self.sttack+1
yase=Hero("yase",900,500)
yase.upgrade()
print("血量为:"yase.up)
print("攻击为:"yase.attack)
print("等级为:"yase.level)
\ 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