#!/usr/bin/python3.6 # -*- coding: utf-8 -*- # @Author : lijunliang # @Email : lijunliang@topnet.net.cn # @File : price.py # @Software: PyCharm """ 单价计算 """ import re com1 = re.compile("^01") com2 = re.compile("^02") com3 = re.compile("^03") com4 = re.compile("^04") com5 = re.compile("^05") com6 = re.compile("^06") def get_pricing(classify: str, pages: int) -> int: ''' 获取价格 :param classify: :param pages: :return: ''' price = 0 if com1.match(classify): price = 0 + 40 * pages if com2.match(classify): price = 100 + 30 * pages if com3.match(classify): price = 300 + 30 * pages if com4.match(classify): price = 300 + 30 * pages if com5.match(classify): price = 300 + 30 * pages if com6.match(classify): price = 0 + 40 * pages return price