Added exception handling for map access Python