Priority Queue Implementation In Python Using Global Variables