Write a program to count characters in a string


Topic: Write a program to count characters in a string

Solution

st = "AmmarAdil"
count = {}
for a in st:
    if a in count:
        count[a]+=1
    else:
        count[a] = 1
print('Count', count)



List all Python Programs