2.0 KiB
title | sidebar | showTitle | hideAnchor |
---|---|---|---|
Our Notes On Python | Handbook | true | true |
Along with reading about any given programming language it's necessary to use that knowledge. I've prepared exercises that will help you use the knowledge you are learning.
Start by reading Python via Learninyminutes then work to complete the exercises below.
1. Fibonacci
You can learn about the fibonacci here. Fibonacci sequence means each number is the sum of the two preceding ones, starting from 0 and 1.
The sequence looks like this 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...
Exercise: Calculate the fibonacci sequence up to 100
2. Invictus text processing
- Read invictus.txt into a string
- Split the string an array of words and print them out
- Correct words with invalid characters and print the cleaned words out
- Create an array of maps of all unique words and how many times they occurred
- Sort the array of maps by the number of times they occurred in descending order
- Convert the code into a class, implement interfaces and type checking if applicable
More exercises
Create your own exercises
One interesting strategy is to:
- Buy/find a programming book you're interested in.
- As your read, create an exercise for that chapter.
- Code the exercise that you created before moving on.
- Rinse and repeat until you've finished the book.
By creating the exercise and solving it, you'll learn better than if you just read the chapter. Remember that many programmers are lazy and are unwilling to put this kind of effort. You'll be light years ahead of your peers as you apply yourself.