首页 > 编程语言 > 详细

python笔记:购物车

时间:2017-10-18 19:40:13      阅读:273      评论:0      收藏:0      [点我收藏+]

product_list=[
    (,),
    (,),
    (,),
    (,),
    (,),
    (,),
]
shopping_list = []salary = ()salary.isdigit():salary =(salary)
    :
        index,item (product_list):(index,item)
        user_choice = ()
        user_choice.isdigit():user_choice =(user_choice)user_choice< (product_list) user_choice >=:p_item =product_list[user_choice]p_item[]<= salary:shopping_list.append(p_item)salary -= p_item[](%(p_item,salary))
                :
                    (%salary)
            :
                  (% user_choice)
        user_choice ==:()
            p shopping_list:
                (p)
            (,salary)
            ()
    :
        ()


python笔记:购物车

原文:http://180505.blog.51cto.com/170505/1973840

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!