Python While Loop Over Hashmap