summaryrefslogtreecommitdiff
path: root/misc/characterCount.py
diff options
context:
space:
mode:
authormlot <petri-rush-curvy@duck.com>2025-06-06 13:40:57 -0400
committermlot <petri-rush-curvy@duck.com>2025-06-06 13:40:57 -0400
commit75a42ec54dbf721caa659ddf02c1f46fc2cb4bef (patch)
tree84be794a2481e356a7784557a6f9fb6fbf29cfdd /misc/characterCount.py
initial commit for archivingHEADmain
Diffstat (limited to 'misc/characterCount.py')
-rw-r--r--misc/characterCount.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/misc/characterCount.py b/misc/characterCount.py
new file mode 100644
index 0000000..de3b2ef
--- /dev/null
+++ b/misc/characterCount.py
@@ -0,0 +1,15 @@
+#!Python
+
+#Character count
+
+import pprint
+
+message = 'It was a bright cold day in April, and the clocks were strinking thirteen.'
+count = {}
+
+for character in message:
+ count.setdefault(character, 0)
+ count[character] = count[character] + 1
+
+pprint.pprint(count)
+print(pprint.pformat(count))