class Book:
prices = {'A':45.7, 'B':56.7, 'C':67.8, 'D':78.9, 'E':90.1}
shipping = {' 包邮区':0, '一类地区':5, '二类地区':10, '特远地区':15}
def __init__(self, name, num, local):
self.name = name
self.num = num
self.local = local
def total(self):
price = Book.prices.get(self.name)
ship = Book.shipping.get(self.local)
t = price * self.num + ship
return t
b = Book('A', 2, '一类地区')
b_total = b.total()
print(b_total)