Mengembalikan versi string dengan huruf judul yang kata-katanya dimulai dengan karakter huruf besar dan karakter sisanya adalah huruf kecil.
str.title()
>>> 'Hello world'.title()
'Hello World'
>>> "they're bill's friends from the UK".title()
"They'Re Bill'S Friends From The Uk"
>>> import re
>>> def titlecase(s):
... return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
... lambda mo: mo.group(0).capitalize(),
... s)
...
>>> titlecase("they're bill's friends.")
"They're Bill's Friends."