Find the position of characters in the query string, the first character in line with the position, find there is no return -1, index will complain
a="i love chian"
fnd=a.find('i')
idx=a.index("n")
print("字符串a中字符i的位置为:%d"%fnd)
print("字符串a中字符n的位置为:%d"%idx)
Determining whether a character string in the string b, returns a Boolean value
a='chian'
b='i love chian'
s= a in b
print(s)
The number of characters within a string of statistics
a="i love chian"
cnt=a.count('i')
print("字符串a中字符i的个数为:%d"%cnt)
Analyzing the letter string is not repeated
https://blog.csdn.net/GrofChen/article/details/92406250