Commit ac67da92 by BellCodeEditor

save project

parent 22354288
Showing with 15 additions and 0 deletions
class Hero:
def __init__(self,nm,xl,gjl):
self.dj=1
self.nm=nm
self.xl=xl
self.gjl=gjl
def sj(self):
self.dj=self.dj+1
self.xl=self.xl+500
self.gjl=self.gjl+40
luban=Hero("鲁班七号",2800,320)
print(luban.gjl,luban.xl,luban.dj)
luban.sj()
print(luban.gjl,luban.xl,luban.dj)
\ 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