

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: Running Python
incomplete
2: Book Data
incomplete
3: Read File
incomplete
4: Count Words
incomplete
5: Refactor
incomplete
6: Count Characters
incomplete
This lesson's interactive features are locked, please to keep using them
Time for our first bit of data analysis! Let's count the words in the book.
The str.split() method splits a string on whitespace characters like spaces and line breaks by default. It's an easy (though not entirely accurate) way to break a string into a list of words.
words = "Books are fun".split()
print(len(words))
# 3
The len() function then gives a word count.
Found {num_words} total words
Replace {num_words} with the book's actual word count.
Run and submit the CLI tests from the root of your project.