import time

while True:     #while 条件为真则该循环体为死循环
    print('快递邮费计算系统')
    time.sleep(0.5)
    print('东三省,宁夏,青海,海南。三公斤内12元-------编号a')
    time.sleep(0.5)
    print('新疆,西藏。三公斤内20元------编号b')
    time.sleep(0.5)
    print('其他地区。三公斤内10元------编号c')
    time.sleep(0.5)
    print('港澳台三斤内不接受邮寄,超过三斤联系总部。------编号d')
    time.sleep(0.5)
    a = 12
    b = 20
    c = 10
    d = None

    weight = int(input('输入重量(kg):'))
    time.sleep(0.5)
    area = input('输入地区编号:')
    #首重内包裹计算策略

    if weight <= 3 and weight>=0:
        if area == 'a':
            time.sleep(0.5)
            print('首重包裹,邮费%d元'%a)
            time.sleep(1)
            print('... ...')
        elif area == 'b':
            time.sleep(0.5)
            print('首重包裹,邮费%d元'%b)
            time.sleep(1)
            print('... ...')
        elif area == 'c':
            time.sleep(0.5)
            print('首重包裹,邮费%d元'%c)
            time.sleep(1)
            print('... ...')
        elif area == 'd':
            time.sleep(0.5)
            print('港澳台.国外不接受邮寄')
            time.sleep(1)
            print('... ...')
        else:
            print('输入错误,重新输入')
            time.sleep(1)
            print('... ...')

    #首重超重包裹计算策略
    elif weight >=3 and weight >0:
        if area == 'a':
            pay = a + (weight -3)*10
            time.sleep(0.5)
            print('超首重包裹,邮费%d'%pay)
            time.sleep(1)
            print('... ...')
        elif area == 'b':
            pay = b + (weight -3)*20
            time.sleep(0.5)
            print('超首重包裹,邮费%d'%pay)
            time.sleep(1)
            print('... ...')
        elif area == 'c':
            pay = c + (weight -3)*5
            time.sleep(0.5)
            print('超首重包裹,邮费%d'%pay)
            time.sleep(1)
            print('... ...')
        elif area == 'd':
            time.sleep(0.5)
            print('港澳台/国外联系总公司邮寄')
            time.sleep(1)
            print('... ...')
        else:
            print('输入错误,重新输入')
            time.sleep(1)
            print('... ...')
    else:
        print('输入错误,重新输入')
        time.sleep(1)
        print('... ...')

扫描二维码,在手机上阅读!
最后修改:2019 年 07 月 07 日 08 : 21 PM
如果觉得我的文章对你有用,请随意赞赏