shopping = [] file = (=) user_data1 = ((file.readline())) file3 = (=) wage_data = ((file3.readline())) user = () passwd1 = () user user_data1 passwd1 user_data1[user]: () choice = () choice == : shopping_history1 = (=) shopping_wage1 = (=) list1 = ((shopping_history1.readline())) list2 = ((shopping_wage1.readline())) shopping_history1.close() shopping_wage1.close() (% list1[user]% list2[user]) user user_data1 passwd1 user_data1[user]: () : wage = () item = [(userpasswd1)] dict1 = (item) dict1.update(user_data1) file1 = (=) file1.write((dict1)) file2 = (=) wage1 = [(userwage)] dict2 = (wage1) dict2.update(wage_data) file2.write((dict2)) file1.flush() file2.flush() file1.close() file2.close() product_list = [ ()()()()()] file4 = (=) wage_data2 = ((file4.readline())) wage = (wage_data2[user]): indexitem (product_list): (indexitem) choice = () (choice) < (product_list): choice_item = product_list[(choice)] choice_item[] <= wage: shopping_history1 = (=) list1 = ((shopping_history1.readline())) shopping.append(choice_item[]) list1[user] = shopping[:] wage -= choice_item[] (% (choice_item[]wage)) () (% (usershopping[:])) shopping_history2 = (=) shopping_history2.write((list1)) wage_history = (=) list3 = ((wage_history.readline())) list3[user] = wage wage_history1 = (=) wage_history1.write((list3)) wage_history1.flush() wage_history1.close() wage_history.close() shopping_history2.flush() shopping_history2.close() shopping_history1.close() (list1) : (% wage) (choice) == : () file4.close()
购物车实现
原创
©著作权归作者所有:来自51CTO博客作者akcgi的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
购物车的实现(未登录时也可以使用)
平时工作的踩坑记录
redis List 拦截器 -
android 购物车代码 购物车代码js
JS实现购物车01 需求使用JS实现购物车功能01具体代码<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>购物车01</title><style type="text/css">
android 购物车代码 javascript html 字符串截取 css