Overview:You are given a list of dictionaries, where each di…
Overview:You are given a list of dictionaries, where each dictionary represents a print job. Write a function convert that transforms this list into a FIFO (Queue), with each print job stored as a named tuple containing the attributes user, document, and pages. Instructions: Import the required modules.Import namedtuple from the collections module and Queue from the queue module. Create a named tuple.Define a named tuple PrintJob with the fields: user, document, and pages. Implement the conversion function.Write a function convert that: Accepts a list of dictionaries as input. Iterates over the list, converts each dictionary into a PrintJob named tuple. Stores each named tuple in a FIFO queue using Queue.put(). Returns the FIFO queue. Example Input: jobs = [ {‘user’: ‘Alice’, ‘document’: ‘Report.pdf’, ‘pages’: 10}, {‘user’: ‘Bob’, ‘document’: ‘Invoice.docx’, ‘pages’: 5}, ] Example usage of the function is NOT required.
Read Details