1.具体代码如下: at_str = ‘@11 @22 @33 @44’ pos = at_str.find(’@’) count = 0 while pos != -1: count = count + 1 print(’@出现位置:{}’.format(pos)) pos = at_str.find(’@’, pos + 1) print(’@总共出现了{}次’.format(at_str.count(’@’))) 2.运行结果如下: