Question: Please use python use a list to simulate a popular collection called a queue, in which you insert at the back and delete from the

Please use python

use a list to simulate a popular collection called a queue, in which you insert at the back and delete from the front. Items are retrieved from queues in first-in, first-out (FIFO) order. Create function add_item() to insert the value to the queue, function remove_item() to remove the value from the queue

Example output:

what is the value: 7

add 7 to list [7]

what is the value: 2

add 2 to list [7, 2]

what is the value: 8

add 8 to list [7, 2, 8]

remove 7 from list [2, 8]

what is the value: 5

add 5 to list [2, 8, 5]

remove 2 from list [8, 5]

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!