python中class的使用 class hello123(object): # def _calculate_(self,a): # self.a=a+1 def __init__(self,a): self.ab=a def __str__(self): return "年龄:%d" % (self.ab) # def calculate_call(self): # return "年龄:%d" % (self.ab) haha = hello123(22) print(haha)