为什么打印出来不是函数方法定义的格式呢?打印出来是(‘xiaoming’,'Male',90)
class Student(object):
def __init__(self, name, gender, score):
self.name = name
self.gender = gender
self.score = score
def __str__(self):
return 'name is {}, gender is {}, score is {}'.format(self.name, self.gender, self.score)
def __repr__(self):
return 'name is {}, gender is {}, score is {}'.format(self.name, self.gender, self.score)
s = ('xiaoming','Male',90)
print(s)