代码无输出
class Person(object): def __init__(self, name, gender): self.name = name self.gender = gender def __str__(self): return '(Person: %s, %s)' % (self.name, self.gender) __repr__ = __str__ p = Person('Bob', 'male') p
试了这段代码,右侧输出栏无内容,为何?
class Person(object): def __init__(self, name, gender): self.name = name self.gender = gender def __str__(self): return '(Person: %s, %s)' % (self.name, self.gender) __repr__ = __str__ p = Person('Bob', 'male') p
试了这段代码,右侧输出栏无内容,为何?
2015-09-24
举报