题目描述
输入描述:
输入数据一个字符串, 包括字母, 数字等.
输出描述:
输出首先出现三次的那个英文字符
示例 1
输入
Have you ever gone shopping and
输出
- e
- import collections
- s = input()
- dict = collections.defaultdict(int)
- for i in s:
- if i.isalpha():
- dict[i] += 1
- if dict[i]==3:
- print(i)
- break
统计字符
来源: http://www.bubuko.com/infodetail-2823593.html