initial creation

This commit is contained in:
2025-05-20 11:57:43 -04:00
commit c98b612926
8447 changed files with 1862526 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env python
counts = {} # <1>
with open("../DATA/breakfast.txt") as breakfast_in:
for line in breakfast_in:
breakfast_item = line.rstrip('\n\r')
if breakfast_item in counts: # <2>
counts[breakfast_item] = counts[breakfast_item] + 1 # <3>
else:
counts[breakfast_item] = 1 # <4>
for item, count in counts.items():
print(item, count)