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 
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
Get step-by-step solutions from verified subject matter experts
