You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
336 B

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()