from queue import PriorityQueue
customers = PriorityQueue() #we initialise the PQ class instead of using a function to operate upon a list. 
customers.put((2, "Harry"))
customers.put((3, "Charles"))
customers.put((1, "Riya"))
customers.put((4, "Stacy"))
while customers:
    print(customers.get())#Will print names in the order: Riya, Harry, Charles, Stacy.
from queue import PriorityQueue
customers = PriorityQueue() #we initialise the PQ class instead of using a function to operate upon a list. 
customers.put((2, "Harry"))
customers.put((3, "Charles"))
customers.put((1, "Riya"))
customers.put((4, "Stacy"))
while customers:
    print(customers.get())#Will print names in the order: Riya, Harry, Charles, Stacy.
#we initialise the PQ class instead of using a function to operate upon a list. #Will print names in the order: Riya, Harry, Charles, Stacy.