0

billing automation

Simple python program for automation of billing. Iam unable to complete it. Please help with the code. Iam a beginner, trying some stuff with what I have learned. link-https://code.sololearn.com/cJ8ZTpdOqxFw

11th Aug 2021, 9:29 AM
Tharun
Tharun - avatar
12 odpowiedzi
+ 7
Tharun , please don't share external links to a code. it is better to use playground for saving your code, then link it here. to see where your problem is and to give you some support, we need to see your code. thanks for your understanding!
11th Aug 2021, 9:35 AM
Lothar
Lothar - avatar
+ 1
Thank u all for your support
11th Aug 2021, 7:25 PM
Tharun
Tharun - avatar
0
Ok sir
11th Aug 2021, 9:38 AM
Tharun
Tharun - avatar
0
Why do I have to click on motorcycle images just to read the code? is it a top secret code?
11th Aug 2021, 9:47 AM
Ipang
0
I don't know bro
11th Aug 2021, 9:50 AM
Tharun
Tharun - avatar
0
Tharun In your code are inputs entered on new line or same line ?
11th Aug 2021, 11:14 AM
Abhay
Abhay - avatar
0
In code playgrounds I entered in different lines but in vscode I entered in same line
11th Aug 2021, 11:16 AM
Tharun
Tharun - avatar
0
I think you want to also ask quantity of each product the customer wants to buy, apart from product name(s). Given the quantity you then multiply unit price by quantity before adding to <sum>.
11th Aug 2021, 11:17 AM
Ipang
0
Yeah I forgot that
11th Aug 2021, 11:18 AM
Tharun
Tharun - avatar
0
import math print("What are you willing to buy mam?") products = { 'apple':10, 'coconut':20, 'shampoo':40, 'oil': 100, 'pineapple':66 } print(products) goods = input('enter the list of products: ') if goods in products: print(goods) else: print('the item you wanted is not available') bill=sum(goods) print('here is your bill mam: ') print(bill) help me to get the code please.
11th Aug 2021, 1:21 PM
Tharun
Tharun - avatar
0
Tharun, Use a loop to read multiple product name & desired quantity. You check whether the product name exists in <products> dictionary. If it exists, then insert a pair of product name & quantity into a dicfionary which acts as a shopping cart.
11th Aug 2021, 1:28 PM
Ipang
0
Firstly, if you want the client to enter the goods in a list then you should loop through the list and get their values in the dictionary. The add the values within the loop. Secondly, "bill= sum(goods)" this does not add the values but rather the item name so you'll get an Error
11th Aug 2021, 6:39 PM
Nwalozie Elijah
Nwalozie Elijah - avatar