import datetime
class Book:
def __init__(self,title,price = 0.0,publisher = '',pubdate = datetime.date.today()):
self.title = title,
self.price = price
self.publisher = publisher
self.pubdate = pubdate
def __repr__(self):
print('图书{}at{}'.format(self.title,id(self)))
def print_informance(self):
print('书名:{}'.format(self.title))
print('价格:{}'.format(self.price))
print('出版社:{}'.format(self.publisher))
print('出版日期:{}'.format(self.pubdate))
book1 = Book('Python入门',88,'清华大学出版社',datetime.date(2020,2,2))
book2 = Book('QDN')
Book.print_informance(book1)
