str "my name is James bond";
print (str.capitalize())
Answers
Answer:
str = "my name is James bond";
print (str.capitalize()) #it will capitalize the first letter of string
output:
My name is James band
Answer:
In computer science, string-searching algorithms, sometimes called as string-matching algorithms, are important class string algorithms that try to find a place where one or the several strings (also called patterns) are found within a larger string or text.
A basic example string searching when the pattern and searched text are arrays of elements of an alphabet (finite set) Σ. Σ may be human language alphabet, example, the letters A through Z other applications may use a binary alphabet (Σ = {0,1}) or DNA alphabet (Σ = {A,C,G,T}) in bioinformatics.
In practice, method of feasible string-search algorithm may be affected by string encoding. In particular, if a variable-width encoding is use, then it may be slower to find Nth character, perhaps requiring time proportional to N. This may significantly slow some of the search algorithms. One of many possible solutions is search for the sequence of the code units instead, but doing so may produce false matches unless the encoding is specifically designed to avoid that.
#SPJ2