Python 字符串查找第一个仅出现一次的字符
s = input()
d = {}
for i in s:
d[i] = d.get(i, 0) + 1
flag = False
for i in s:
if d[i] == 1:
print(i)
flag = True
break
if not flag:
print('No')
原文地址: https://www.cveoy.top/t/topic/ocvK 著作权归作者所有。请勿转载和采集!