a = 'hello world'
b = []
for i in a:
    if '%s:%s' % (i, a.count(i)) not in b:
        b.append('%s:%s' % (i, a.count(i)))
print(b)

  

相关文章:

  • 2022-12-23
  • 2021-11-09
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案