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
12 RĂ©ponses
+ 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!
+ 1
Thank u all for your support
0
Ok sir
0
Why do I have to click on motorcycle images just to read the code? is it a top secret code?
0
I don't know bro
0
Tharun In your code are inputs entered on new line or same line ?
0
In code playgrounds I entered in different lines but in vscode I entered in same line
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>.
0
Yeah I forgot that
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.
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.
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