python_exercises/thinkcspy/Chapter-12-Exercises/Lab1.py

16 lines
No EOL
323 B
Python

# Runestone.Academy thinkcspy course
# Chapter 12
# Lab 1
def countAll(text):
wordDict = {}
for char in text:
if char not in wordDict and char.isalpha():
wordDict[char] = text.count(char)
return wordDict
print(countAll("banana"))
print(countAll("curly fries 123!"))