Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Jun 3, 2021
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