I have to replace the north, south, etc with N S in address fields.
If I have
list = {\'NORTH\':\'N\',\'SOUTH\':\'S\',\'EAST\':\'E\',\'WEST\':\'W\'}
address = "123 north anywhere street" for word, initial in {"NORTH":"N", "SOUTH":"S" }.items(): address = address.replace(word.lower(), initial) print address
nice and concise and readable too.