Question: Python This program saves hardware inventory to a file named stock.txt . The program should prompt the user for the name and quantity in stock

Python

This program saves hardware inventory to a file named stock.txt. The program should prompt the user for the name and quantity in stock for as many inventory items as desired, but you should enter at least four inventory items. Each item name should be saved on its own line in the file, and be followed by its quantity on the next line. You must use a loop that will continue until no item name is entered. The program should generate a confirmation message when done. See Sample Output next.

Sample Output Python This program saves hardware inventory to a file named stock.txt. The

Enter the inventory item name, or Enter to quit claw hammer Enter the quantity in stock for this item 12 Enter the inventory item name, or Enter to quit locking pliers Enter the quantity in stock for this item 9 Enter the inventory item name, or Enter to quit adjustable wrench Enter the quantity in stock for this item 15 Enter the inventory item name, or Enter to Enter the quantity in stock for this item 10 Enter the inventory item name, or Enter to quit Inventory file was created quit phillips screwdriver

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!