Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In an electronic shop, X number of brands are available namely 'a', 'b', 'c','d', 'e'. Unit price of the brands of X are 140, 200,
In an electronic shop, X number of brands are available namely 'a', 'b', 'c','d', 'e'. Unit price of the brands of X are 140, 200, 180, 400 and 300 respectively and the available stock in hand is 10 for a, 100 for b,50 for c, 4 for d, and 2 for e. A customer can enter the name of the brand of X he wants to purchase and the required quantity.Write the Python code to keep track of total bill amount. The program should keep asking for new items until nothing is entered (no input followed by enter/return key). The program should display the total amount. The brand name entered by the customer should be made case in sensitive and if the user enters quantity greater than stock in hand then print "QUANTITY INSUFFICIENT". If the brand entered by the user is not in the shop then print "MODEL NOT AVAILABLE. But in both the cases compute cost for other items entered and continue getting new items. Print the items ordered by the customer in lower case and unit price of the item as a dictionary in sorted order and then the total cost to be paid by the customer. Syntax for pprint is pprint(dictionary name)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started