回覆列表
  • 1 # fluhr2988

    或d = {i: s.count(i) for i in set(s) if i.isalpha()}或

  • 2 # 使用者6354188383803

    s="sfawaef#$#%fdf1232"

    d = dict((i, s.count(i)) for i in set(s) if i.isalpha())

    d = {i: s.count(i) for i in set(s) if i.isalpha()}

    from string import ascii_letters

    d = {i: s.count(i) for i in set(s) if i in ascii_letters}

    from collections import Counter

    from string import ascii_letters

    d = Counter(i for i in s if i in ascii_letters)

  • 中秋節和大豐收的關聯?
  • AB型血會和什麼血型發生溶血?