python超市购物清单
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python超市购物清单相关的知识,希望对你有一定的参考价值。
#!/usr/bin/env python #-*-coding:utf-8-*- pro_name_1 = ‘特仑苏‘ pro_prince_1 = 48 pro_total_1 = pro_price_1*1 pro_name_2 =‘卡通垃圾面‘ pro_prince_2 =2.5 pro_total_2 = pro_price_2*1 pro_name_3 = ‘面巾纸‘ pro_price_3 = 3.3 pro_count = 4 pro_total_3 = pro_price_3*pro_count_3 pro_name_4 = ‘燕麦片‘ pro_price_4 = 23 pro_total_4 = pro_price_4*1 pro_name_5 = ‘dove洗面奶‘ pro_price_5 = 16.8 pro_count_5 = 4 pro_total_5 = pro_price_5*pro_count_5 print‘------------购物清单-------------‘;print ‘商品名称‘+‘ ‘+‘数量‘+‘ ‘+‘单价‘+‘ ‘+‘总计‘+‘;print pro_name_1+‘ ‘+‘1‘+‘ ‘str(pro_price_1)+‘ ‘+str(pro_total_1);‘print pro_name_2+‘ ‘+‘1‘+‘ ‘str(pro_price_2)+‘ ‘+str(pro_total_2);‘print pro_name_3+‘ ‘+‘1‘+‘ ‘str(pro_price_3)+‘ ‘+str(pro_total_3);‘print pro_name_4+‘ ‘+‘1‘+‘ ‘str(pro_price_4)+‘ ‘+str(pro_total_4);‘print pro_name_5+‘ ‘+‘1‘+‘ ‘str(pro_price_5)+‘ ‘+str(pro_total_5);‘\
以上是关于python超市购物清单的主要内容,如果未能解决你的问题,请参考以下文章