统计一个字符串里面的某个特定字符的出现个数

bin(3).count('1')

使用count函数即可

posted on 2021-09-17 21:37  little_power  阅读(26)  评论(0)    收藏  举报