from collections import deque deque(["task ""task ""task "] append("task "print("handling" popleft()handling task unsearched deque([starting_node]def breadth_first_search(unsearched)node unsearched popleft(for in gen_moves(node)if is_goal( )return unsearched append(min addition to alternative list implementationsthe library also offers other tools such as the bisect module with functions for manipulating sorted listsimport bisect scores [( 'perl')( 'tcl')( 'lua')( 'python')bisect insort(scores( 'ruby')scores [( 'perl')( 'tcl')( 'ruby')( 'lua')( 'python')the heapq module provides functions for implementing heaps based on regular lists the lowest valued entry is always kept at position zero this is useful for applications which repeatedly access the smallest element but do not want to run full list sortfrom heapq import heapifyheappopheappush data [ heapify(datarearrange the list into heap order heappush(data- add new entry [heappop(datafor in range( )fetch the three smallest entries [- decimal floating point arithmetic the decimal module offers decimal datatype for decimal floating point arithmetic compared to the built-in float implementation of binary floating pointthe class is especially helpful for financial applications and other uses which require exact decimal representationcontrol over precisioncontrol over rounding to meet legal or regulatory requirementstracking of significant decimal placesor applications where the user expects the results to match calculations done by hand for examplecalculating tax on cent phone charge gives different results in decimal floating point and binary floating point the difference becomes significant if the results are rounded to the nearest centfrom decimal import round(decimal(' 'decimal(' ') decimal(' 'round brief tour of the standard library -part ii