WeCodeAcademy

Working with Text Data

Real programs read files. Here we use a multi-line string to practise the same ideas: splitting into lines, cleaning each line and counting words.

Examplepython
Open in editor »
Quick check

What does `text.splitlines()` return?

Your turn: write the code

Print how many lines text has.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.