[Python] python统计字符串中指定字符出现的次数 →→→→→进入此内容的聊天室

来自 , 2019-05-10, 写在 Python, 查看 106 次.
URL http://www.code666.cn/view/d0f5722f
  1. s = "Count, the number     of spaces."
  2. print s.count(" ")
  3.  
  4. x = "I like to program in Python"
  5. print x.count("i")

回复 "python统计字符串中指定字符出现的次数"

这儿你可以回复上面这条便签

captcha