sh_15_字符串统计操做

  sh_15_字符串统计操做html hello_str = "hello hello" # 1. 统计字符串长度 print(len(hello_str)) # 2. 统计某一个小(子)字符串出现的次数 print(hello_str.count("llo")) print(hello_str.count("abc")) # 3. 某一个子字符串出现的位置 print(hello_str
相关文章
相关标签/搜索