Commit 6a0b03b1 by BellCodeEditor

save project

parent 22354288
Showing with 19 additions and 0 deletions
class hero:
def __init__(self,q,d,f,j):
self.name= q
self.xueliang = d
self.dengji = f
self.lan = j
#yase = hero('亚瑟',300,1,20)
def upgrade(self):
self.dengji=self.dengji+1
self.xueliang=self.xueliang+50
self.lan=self.lan+4
yase = hero('亚瑟',300,1,20)
yase.upgrade()
print('等级为',yase.dengji)
print('血量为',yase.xueliang)
print('蓝',yase.lan)
\ 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