Answered by : tejas-naik
# To capitalize the first letter in a word or each word in a sentence use .title()
name = tejas naik
print(name.title()) # output = Tejas Naik
Source : | Last Update : Sun, 29 Nov 20
Answered by : alii
>>> "hello world".title()
'Hello World'
>>> u"hello world".title()
u'Hello World'
Source : https://stackoverflow.com/questions/1549641/how-can-i-capitalize-the-first-letter-of-each-word-in-a-string | Last Update : Thu, 01 Jul 21
Answered by : ismail-albatrookh
import camelcase
c = camelcase.CamelCase()
txt = "Welcome Dear ismail "
print(c.hump(txt))
Source : | Last Update : Fri, 02 Dec 22
Answered by : comfortable-copperhead-ieujykk2vd2q
"hello world".title()
'Hello World'
>>> u"hello world".title()
u'Hello World'
Source : | Last Update : Wed, 03 Jun 20
Answered by : you
string = "hello world"
capitalized = string[0].upper() + string[1:]
print(capitalized)
Source : | Last Update : Mon, 18 Sep 23
Answered by : helpless-hamster-iyyzaozffwgx
>>> "hello world".title()
'Hello World'
>>> u"hello world".title()
u'Hello World'
Source : https://stackoverflow.com/questions/1549641/how-can-i-capitalize-the-first-letter-of-each-word-in-a-string | Last Update : Tue, 28 Jun 22
Answered by : timothy-wangwe
# Use title() to capitalize the first letter of each word in a string.
name = "elon musk"
print(name.title())
# Elon Musk
Source : | Last Update : Sun, 20 Jun 21
Answered by : esin-shadrach
text = "this is an example text"
print(text.title())
Source : | Last Update : Tue, 16 Aug 22