python first letter in string code example
Example 1: how to capitalize first letter in python
# 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
Example 2: python get first character of string
string = 'This is a string'
print(string[0])
#output: 'T'
Example 3: how to find the first letter of an item in python
mylist[0][0] # get the first character from the first item in the list