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
相關文章
相關標籤/搜索