题解 | #找出字符串中第一个只出现一次的字符#
找出字符串中第一个只出现一次的字符
http://www.nowcoder.com/practice/e896d0f82f1246a3aa7b232ce38029d4
直接复制其他人的for else都不行,会同时输出o和-1,是我电脑问题吗?
while 1:
try:
a=input()
tes=[]
for i in a:
if a.count(i)==1:
tes.append(i)
print(i)
break
if tes==[]:
print('-1')
except:
break