Question: I'm working on a python script to convert full uppercase addresses to Title Case. The issue I'm facing is that when I apply `.title()` to a string like *SOUTH 16TH STREET*, I get *South 16**Th** Street*. The desired conversion would be *South 16**th** Street*, where the abbreviation to the ordinal is lowercase.

*What is a simple way in python to accomplish this?* I was thinking about using some kind of regex.

Answer: 
It might be easiest to split the string into a list of separate words, capitalize each word and then join them back together:

```
>>> address = "SOUTH 16TH STREET"
>>> " ".join([word.capitalize() for word in address.split()])
'South 16th Street'

```

The `capitalize()` method sets the first character of a string to uppercase and the proceeding characters to lowercase. Since numbers don't have upper/lowercase forms, "16TH" and similar tokens are transformed as required.
```
>>> str_='SOUTH 16TH STREET'
>>> ' '.join([i.title() if i.isalpha() else i.lower() for i in str_.split()])
'South 16th Street'

```