Exercise: count characters


  • Write a script called count_characters.py that given a long text will count how many times each character appears.
  • Change the code so it will be able to count characters in a file.


examples/dictionary/count_characters_skeleton.py

text = """
This is a very long text.
OK, maybe it is not that long after all.
"""