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))
标签:index body ret for bsp 出现 print 查找 mat
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))
标签:index body ret for bsp 出现 print 查找 mat
原文地址:https://www.cnblogs.com/dancesir/p/8258859.html