题解 | #找出字符串中第一个只出现一次的字符#
DNA序列
http://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
# 输入字符串
s = input()
# 找到第一个只出现一次的字符
ans = -1
for i in s:
if s.count(i) == 1:
ans = i
break
print(ans)
DNA序列
http://www.nowcoder.com/practice/e8480ed7501640709354db1cc4ffd42a
# 输入字符串
s = input()
# 找到第一个只出现一次的字符
ans = -1
for i in s:
if s.count(i) == 1:
ans = i
break
print(ans)
相关推荐