s = 'hellobaby'
def findchar(s):
    for i in s:
        if s.count(i)==1:
            return i, s.index(i)
m,n=findchar(s)
print('第一个出现一次的字符是{},位置是{}'.format(m,n))

 

相关文章:

  • 2021-12-30
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-10-11
  • 2021-07-09
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2022-03-07
  • 2021-10-19
  • 2021-05-29
  • 2021-11-12
  • 2021-11-26
相关资源
相似解决方案