快递计费系统

##快递计费系统 Python

print("欢迎来到快递系统!")
while 1==1:
    weight = int(input("请输入重量(千克):"))
    num = input("请输入地区编号(01、华东地区  02、华南地区  03、华北地区");
    p = 0
    if weight > 2:
        if num =="01":
            p = 13+3*(weight-2)
        elif num =="02":
            p = 12 + 2 * (weight - 2)
        elif num == "03":
            p = 14 + 4 * (weight - 2)
    elif weight <= 2 and weight>0:
        if num == "01":
            p = 13;
        elif num == "02":
            p = 12;
        elif num == "03":
            p = 14;
    print("您好,此件包裹价格为:",p,"元")

你可能感兴趣的:(代码)