

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Organize Data
incomplete
2: Print a Report
incomplete
3: Arguments
incomplete
This lesson's interactive features are locked, please to keep using them
Our data is organized; now it's time to print a pretty report!
The character-count dictionary includes spaces, punctuation, and other symbols that don't belong in the report. We can filter those out using the str.isalpha() method, which returns True when a string is non-empty and all of its characters are alphabetic:
"a".isalpha()
# True
"!".isalpha()
# False
Print the report in this format:
============ BOOKBOT ============
Analyzing book found at books/frankenstein.txt...
----------- Word Count ----------
Found 75767 total words
--------- Character Count -------
e: 44538
t: 29493
a: 25894
o: 24494
i: 23927
n: 23643
s: 20360
r: 20079
h: 19176
d: 16318
l: 12306
m: 10206
u: 10111
c: 9011
f: 8451
y: 7756
w: 7450
p: 5952
g: 5795
b: 4868
v: 3737
k: 1661
x: 691
j: 497
q: 325
z: 235
æ: 28
â: 8
ê: 7
ë: 2
ô: 1
============= END ===============
str.isalpha() to skip non-alphabetic characters.Run and submit the CLI tests from the root of your project.