class book: id = 0; name = '' position = '' def __init__(self, id, name, position): self.id = id self.name = name self.position = position def speak(self): print("%d号图书是《%s》,在%s。"%(self.id, self.name, self.position)) b1 = book(1, 'a', 'a001') b1.speak()