Defining strings
You can use "" or '' to put strings into them.
Input and output formats
Input input ("input content")
output print ("results that need to be output")
Slice
Slice: refers to intercepting a part of the object of the operation The operation of (applicable to strings, lists, tuples) [start subscript: end: step]
The index in the string is 0-based, the index of the last element is -1
The selected interval starts from " Start, to the end of the previous bit of the "end" bit (excluding the end bit itself, the step size indicates the selection interval) to
extract the first three characters
Get the value of the corresponding
index, extract all characters ,
take every other character, take one character
from right to left, and take one character
string operation
find keyword to check whether the character is included in the string, if it returns the starting index value, then Returns
a string in -1 format.find(str,start=0,end=len(mystr))
number of queries: count()
replaces
the split
Take str as the split slice mystr, if maxsplit has a specified value, only separate maxsplit strings
Format my——str.split (str=" ", 2)
remove the spaces at both ends
Remove the strings on both sides: **strip()** delete the blank characters at both ends of the mystr string
startswith() starts with what startswith() checks Whether the string starts with
str Return true if not return false Uppercase find() function adds a value to a string