> string : string are fundamental in computer science and processing string in a common task in
programming we have string used in input and output the input function return a string form
keyboard and print function display a string on the [Link] are considered as the most
popular data type present in python language string is a sequence of one or more character
here the character can be letter,digit,white space,or any other syntax an string can created by
enclosing one or more character in single,double and triple.
>accessing character in a string by index number
[Link] : each individual character in a string can be accessed using a technique called
[Link] index character to be accessed in the string and is written in square brackets[] the
index of first character (from left) in the string is 0 and last character is n-1 where n is the length
of the string if we give index value out this range then we get an index error.
[Link] indexing : we can also print the element by using negative indexes. The negative
index start from last element and denoted -1 . negative index is very helpful in python string
when we have to print element from last and we dont know the length of the string. Negative
index are used when we want to access the character of the string from right to left
👍
>string method
[Link] : it converts the initial letter of the string to uppercase
[Link]() : it converts the entire string to lowercase.
[Link]() : it aligns the string at the center of the specified length.
[Link](): it returns the number of times a substring occurs in the given string.
[Link]() : it converts the string into the encoded version.
[Link]() : it returns true if the given string starts with a specified [Link] false.
[Link]() : it returns true if the given string ends with a specified [Link] false.
[Link]() : the method sets the tab size to the specified number of [Link] default
tab size is 8 character space.
[Link]() : it helps to format the string by making use of placeholders.