How to stop my reciept stop repeating itself

后端 未结 2 1730
轮回少年
轮回少年 2021-01-28 00:55

This is a program which asks a user to input a barcode , then my program finds the specified product , asks the user how many of a product they would like to purchase , if they

2条回答
  •  抹茶落季
    2021-01-28 01:48

    first try removing all the "global total_price" definitions in your functions.. (it would reset the variable each time) Secondly in your function search_user_input() i would change the line price = round(float(row[2]),2) into price = float(row[2]) (you can later use format to display the final float value in the desired format). Thirdly in your function quantity() you should change the line if continue_shopping !=0 and continue_shopping !=1: into if continue_shopping ==0 or continue_shopping ==1: , good luck

提交回复
热议问题