53 lines
2.0 KiB
Markdown
53 lines
2.0 KiB
Markdown
---
|
|
title: Our Notes On Python
|
|
sidebar: Handbook
|
|
showTitle: true
|
|
hideAnchor: 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](https://learnxinyminutes.com/docs/python/)
|
|
then work to complete the exercises below.
|
|
|
|
## 1. Fibonacci
|
|
|
|
You can learn about the [fibonacci here](https://en.wikipedia.org/wiki/Fibonacci_number). 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
|
|
|
|
1. Read [invictus.txt](https://raw.githubusercontent.com/buwilliams/learn-posthog/main/docs/exercises/02_invictus.txt) into a string
|
|
2. Split the string an array of words and print them out
|
|
3. Correct words with invalid characters and print the cleaned words out
|
|
4. Create an array of maps of all unique words and how many times they occurred
|
|
5. Sort the array of maps by the number of times they occurred in descending order
|
|
6. Convert the code into a class, implement interfaces and type checking if applicable
|
|
|
|
## More exercises
|
|
|
|
- [Programming Problems](https://adriann.github.io/programming_problems.html)
|
|
|
|
## Create your own exercises
|
|
|
|
One interesting strategy is to:
|
|
|
|
1. Buy/find a programming book you're interested in.
|
|
2. As your read, create an exercise for that chapter.
|
|
3. Code the exercise that you created before moving on.
|
|
4. 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.
|
|
|
|
## Useful resources
|
|
- [Python via Learninyminutes](https://learnxinyminutes.com/docs/python/)
|
|
|
|
**[Back: Technologies to learn](../technologies-to-learn)** |