Day 3 EX 购物车自写
2024-08-24 02:05:29
# -*- coding: utf_8 _*_
# Author:Vi
import copy
goods = [0,[1,'iphone',20],[2,'ipad',2500]]
salary = int(input("Please tell me your salary:"))
list = ['My list:']
count = 0
while count< 1:
good_good = copy.deepcopy(goods)
print(goods[1:])
n = int(input("Tell me your thing's ID:"))
if good_good[n][2] > salary:
print("You have not enough money~")
break
elif good_good[n][2] < salary:
print("Yeap,you have brought it!")
salary = salary - good_good[n][2]
list = list + good_good[n]
refree = input("Do you wang to buy something more?Please tell me yes or no.")
if refree == 'yes':
continue
else:
print(list)
print("I still have",salary,"yuan")
break
啊,Yeah!
最新文章
- 基于Codeigniter框架实现的APNS批量推送—叮咚,查水表
- 第3.2 使用案例1:股票期货stock portfolio 21050917
- LINQ to SQL语句(4)之Join
- CSS3 3D骰子
- 蓝牙的HFP协议笔记
- WM (Constants)
- linux 下某个文字在某几行的shell 写法 。
- binarySearch二分查找——Javascript实现
- EasyUI 使用注意点
- 【Oracle】-【ROWNUM与索引】-索引对ROWNUM检索的影响
- YoMail 邮箱客户端的社会化之路,起于邮箱,不止于邮件
- typescript简介
- [20180813]刷新共享池与父子游标.txt
- elk kibana查询语法
- docker 安装nginx、php-fpm
- nginx下No input file specified错误的解决
- 【Unity】2.1 初识Unity编辑器
- 文件打包代码更新 使用json记录打包文件信息
- .Net WebApi部署问题
- 自定义圆形头像CircleImageView的使用和源码分析