p = 0 s = \'How can i get there?\' for i in s: if i == \'P\'or i == \'p\': p = p + 1 else: continue if p != 0: print(\'有\',p,\'个\') else: print(\'无\') 相关文章: