Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created March 12, 2021 07:26
Embed
What would you like to do?
def count_characters(s):
count = {}
for i in s:
if i in count:
count[i] += 1
else:
count[i] = 1
print(count)
print(count_characters("Thecleverprogrammer"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment