Luggage_Weight=int(input("输入你的行李总重量:"))
Is_First=int(input("是否为头等舱?1为是,0不是:"))
Is_Home=int(input("是否为国内乘客?1为是,0不是:"))
Is_physical=int(input("是否为残疾乘客?1为是,0不是:"))
tota=Luggage_Weight-30
if Luggage_Weight>30:
     if Is_First and Is_Home:
         print("你的运费为:",tota*4)
     elif Is_First==0 and Is_Home:
         print("你的运费为:",tota * 6)
     elif Is_First==0 and Is_Home==0:
         print("你的运费为:",tota * 12)
     elif Is_physical and  Is_First==0:
         print("你的运费为:",tota * 3)
     else:
         print("输入错误!!!")
else:
print("你的行李总总量小于30kg,享受免费托运")

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐