class Student():
def __init__(self,name,gender,score):
self.name=name
self.gender=gender
self.score=score
def __str__(self):
return 'Student:{},{},{}'.format(self.name,self.gender,self.score)
def __repr__(self):
return 'Student:{},{},{}'.format(self.name,self.gender,self.score)
Alice=Student('Alice','Female',90)
print(Alice)
定义了类,输出你也没直接类调用方法啊,直接打印这个类是干嘛呢???????