37일차 - Count characters in your string


--------------------------------------------🤞 My Solution -------------------------------------------

def count(string):
    arr = []
    for i in range(0, len(string)):
        arr.append(string[i])
    list = []
    for i in arr:
        if i not in list:
            list.append(i)
    result = {}
    for i in list:
        result[i] = string.count(i)
    return result

좋은 웹페이지 즐겨찾기