From the course: Python for Non-Programmers
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Splitting a string - Python Tutorial
From the course: Python for Non-Programmers
Splitting a string
- [Instructor] Congratulations. You've learned enough Python to bring on yet another project. This project is going to be the word counter. The idea is that we can take a really large piece of text, maybe a speech, a song, a whole book even, and we can say this is how many words there are in this piece of text and this is how often this word appears or this word or this word. So before we move forward, there's one last concept that we've got to learn and that's how do we take text and then put it into a list so that we can actually loop through and do some analysis on it. So the first thing that we want to do is we want to get a really large piece of text and so, for this, I'm going to use The Gettysburg Address, a famous speech by Abraham Lincoln. My grandma, growing up, always told me, she'd give me 20 bucks if I memorized it. I never did, but I will never forget what The Gettysburg Address is because of that.…