Question: Can someone help me write a menu programs consists of the follow as well as calls these functions? What you like to do press a
Can someone help me write a menu programs consists of the follow as well as calls these functions? What you like to do press a number 1. Add an Element 2. Delete an Element 3. Modify Elements 4. Search Elements 5. Show Elements 6. Exit
.





This program adds coffee inventory records to # the coffee.txt file. def add_coffee): # Create a variable to control the loop. another-y coffee fileopen ('coffee.txt, 'a) while another-y or another-Y. # Open the coffee.txt file in append mode. # Add records to the file # Get the coffee record data print (Ent descr input ( Description: ) ter the following coffee data) int input 'Quantity ( in pounds) # Append the data to the file. coffee file.write ( descr + nn) coffee_file.write( str ( qty) +In) # Determine whether the user wants to add # another record to the file. print ("Do you want to add another record?) another input ( = yes, anything else = no: ) # Close the file coffee_file.close ) print ("Data appended to coffee.txt.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
