Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 screwdriverStep 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