Iterate Over Dictionary Python Using Global Variables