Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write Python codes to develop a product recording system. It should allow the user to type product names one by one until he enters an

Write Python codes to develop a product recording system. It should allow the user to type product names one by one until he enters an empty product name. Display entered product names and quantities so that each line is formatted as "---[product name]: [quantity]." For example, a user types 'beef', 'beef', 'milk', 'steak', 'tomato', 'potato', 'milk', 'tomato', 'potato', 'beef'. Your program should display at the end:

The products you entered and quantities are:

---beef: 3

---milk: 2

---steak:1

---tomato: 2

---potato: 2

Note: the order of product names does not matter.

Hint: Use a dictionary to take a record of the product and update the quantity; using a for loop to display products and quantities.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

Demonstrate three aspects of assessing group performance?

Answered: 1 week ago