我是靠谱客的博主 玩命百褶裙,这篇文章主要介绍python入门--嵌套if语句,现在分享给大家,希望可以做个参考。

 

# 作者:林代码er
# 开发时间:2022/9/12 15:09
'''会员 》=200 打八折
       》=100打九折
       不打折

    非会员 》=200打95折
           不打折'''

answer=input("你是会员吗?y/n")
money=float(input("请输入付款金额"))
if answer=='y' :
    if money>=200:
        print('打八折付款金额为:',money*0.8)
    elif money>=100:
        print('打九折付款金额为:',money*0.9)
    else:
        print("不打折",money)
else:
    if money>=200:
        print('打9.5折,付款金额为',money*0.95)
    else:print("不打折,付款金额为",money)

 

最后

以上就是玩命百褶裙最近收集整理的关于python入门--嵌套if语句的全部内容,更多相关python入门--嵌套if语句内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(116)

评论列表共有 0 条评论

立即
投稿
返回
顶部