Create a program to generate a text file to produce a quote for a customer wishing to purchase external hard drives from CGL Computer Products company. Create a dictionary of the following drives (item number is key and price is the value) bellow
{335160:484.99,354732:221.44,3514676:257.42,3006905:315.55,3351600:447.50,357888:379.15}
Open a new text file to create a quote for the customer. Ask the customer for the item number and quantity they wish to purchase. Search your dictionary to retrieve the price based on the item number. Allow the customer to purchase multiple items. Print a header for the quote, column headings, line items for the quantity and description of each item purchased and the total price. After all items have been listed, calculate shipping as 3% of the total, add the shipping to the total to display the total amount due. Tax calculation is not necessary.
d = {}
n = int(input("Enter the number of items: "))
for i in range(n):
item = input("Item code: ")
price = int(input("Item price: "))
d[item] = price
s_item = input("Input the code of the item you are looking for: ")
print(d[s_item])
Comments
Leave a comment