How to stop my reciept stop repeating itself

后端 未结 2 1728
轮回少年
轮回少年 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:42

    Well, it is not rounded as intended, because you store it as a String first and round it second.

    I would recommend to swap the lines values = [str(product), str(price), str(order*price)] and price = str(round(price,2))

提交回复
热议问题