YouTip LogoYouTip

Python3 String Title

# Python3.x Python3 title() Method [![Image 3: Python3 Strings](#) Python3 Strings](#) * * * ## Description The Python title() method returns a "titlized" string, which means all words have their first letter capitalized and the rest of the letters are lowercase (see [istitle()](#)). ## Syntax The syntax for the title() method is: str.title(); ## Parameters * NA. ## Return Value Returns a "titlized" string, meaning all words have their first letter capitalized. ## Example The following example demonstrates the use of the title() function: ## Example (Python 3.0+) #!/usr/bin/python3 str = "this is string example from tutorial....wow!!!"print(str.title()) The output of the above example is: This Is String Example From Tutorial....Wow!!! Please note that the first letter after a non-letter character will be converted to uppercase: ## Example (Python 3.0+) #!/usr/bin/python3 txt = "hello b2b2b2 and 3g3g3g"x = txt.title()print(x) The output is: Hello B2B2B2 And 3G3G3G * * Python3 Strings](#)
← Python3 String TitlePython3 String Strip β†’