String.ToTitle

This should work if you still want it:

for string in a:
  ind = -2
  newstring = ""
  for i, char in enumerate(string):
    try:
      if isinstance(int(char),int):
        ind = i
        newstring += char
    except ValueError:
      if i == ind + 1:
        newstring += char.lower()
      else:
        newstring += char
  b.append(newstring)

Example:

1 Like