• 7.27每日作业之购物车改装升级


    # 默写:
    #
    # 必做:将购物车升级为带有持久存储的,并使用函数件业务逻辑抽离,是的代码更加清晰整洁
    # 购物车功能:
    # 登录
    # 注册
    # 查看商品列表
    # 加入购物车
    # 余额充值
    # 购物车商品结算
    # 可随时提出系统
    import os
    product_list = [['Iphone7',5800],
    ['Coffee',30],
    ['疙瘩汤',10],
    ['Python Book',99],
    ['Bike',199],
    ['ViVo X9',2499], ]
    for index, product in enumerate(product_list):
    print(index, product)

    # current_userinfo=[]
    # db_file=r'db.txt'
    # while True:
    # print("""
    # 1.注册
    # 2.登陆
    # 3.购物
    # """)
    # choice=input('选择>>>:')
    # if choice=='1':
    # name=input('用户名:').strip()
    # while True:
    # pwd=input('密码:').strip()
    # pwd1=input('确认密码:').strip()
    # if pwd==pwd1:
    # print('注册成功')
    # break
    # else:
    # print('密码不一致,请重新输入')
    # recharge=input('充值金额:').strip()
    # with open(db_file, mode='a', encoding='utf-8') as f:
    # f.write('%s,%s,%s ' %(name, pwd, recharge))
    # elif choice=='2':
    # tag=True
    # count=0
    # while tag:
    # if count==3:
    # print('尝试次数过多,退出')
    # break
    # name=input('用户名:')
    # pwd=input('密码:')
    # with open(db_file,mode='rt',encoding='utf-8') as r_f:
    # for line in r_f:
    # line=line.strip(' ')
    # user_info=line.split(',')
    # recharge_am=int(user_info[2])
    # if name==user_info[0] and pwd==user_info[1]:
    # print('登陆成功')
    # current_userinfo=[name,recharge_am]
    # print('用户信息:',current_userinfo)
    # tag=False
    # break
    # else:
    # print('密码错误')
    # count+=1
    # elif choice=='3':
    # pass
    # else:
    # print('非法输入')












    # 选做功能:
    # 删除购物车商品
    # 商品列表添加
    # 商品价格修改








    # 选做题
    # 作业需求:
    # 模拟实现一个ATM + 购物商城程序
    # 额度 15000或自定义
    # 实现购物商城,买东西加入 购物车,调用信用卡接口结账
    # 可以提现,手续费5%
    # 每月22号出账单,每月10号为还款日,过期未还,按欠款总额 万分之5 每日计息
    # 支持多账户登录
    # 支持账户间转账
    # 记录每月日常消费流水
    # 提供还款接口
    # ATM记录操作日志
    # 提供管理接口,包括添加账户、用户额度,冻结账户等。。。
    # 用户认证用装饰器
  • 相关阅读:
    设计模式1 设计模式概述
    关于jdk的配置
    搭建webpack项目框架
    移动乐淘day1
    前后端开发(2):浏览器与PHP程序的交互
    Ajax中post与get的区别
    Web前端:2、盒模型的组成
    Web前端:1、HTML&CSS概述及结构
    VMware11虚拟机安装Redhat6.5视频演示
    VMware虚拟机中安装Linux系统步骤(Redhat6.5)
  • 原文地址:https://www.cnblogs.com/Maikes/p/9458854.html
Copyright © 2020-2023  润新知