加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

购物车作业

发布时间:2020-12-17 00:01:49 所属栏目:Python 来源:网络整理
导读:div class="cnblogs_code" li=[{ : , :10 : , :20 : , :30 ( =input( = money.isdigit() int( money ) > 1 i,k ( .format(i,k[ ],k[ = input( choose.isdigit() int(choose) = input( li[int(choose)][ ] * int(num) = int(money) - li[int(choose)][ ] * li

<div class="cnblogs_code">

li=[{:,:10:,:20:,:30(=input(= money.isdigit()  int( money ) > 1 i,k (.format(i,k[],k[= input( choose.isdigit()  int(choose) <= input( li[int(choose)][] * int(num) <== int(money) - li[int(choose)][] * li[int(choose)][] ]]=shopping_car[li[int(choose)][]]+]]=((
            (()

PS:一、li=[{},{}],列表里面包含字典

  二、isdigit()函数判断数字类型

  三、li[int(choose)]['price']

  四、for i,k in

      print('序号{},商品名称{}.商品价格{}'.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读