I have to replace text like "north", "south", etc. with "N", "S" etc. in address fields. I thought of making a dictionary to hold the replacements. Suppose we have:
replacements = {'NORTH':'N','SOUTH':'S','EAST':'E','WEST':'W'}
address = "123 north anywhere street"
Can I use the replacements
dictionary to do all the replacements, for example by iterating over it? What would the code for this look like?