Hello you, my dear reader.
How are you today?
I hope you’re doing well.
If yesterday’s lesson appeared long and tough…
First of all, make sure you did it:
What Is Data?
Every single day you share tons of data with mostly few American companies (Amazon, Apple [not so much thanks to their business model], Facebook [way too much BECAUSE OF their business model], Instagram [which belongs to Facebook], Google [same business model as Facebook], and some others) that you use on your mobile phone or tablet or computer or elsew…
And for those who want to jump directly to the code, here it is: https://colab.research.google.com/drive/1yJCLmp8MmmDTXmf2OG5q4ghpoZOjgBEX?usp=sharing
Today We Take The Control
Calm down, I’m not launching a revolution, I’m just playing with words.
Programming is probably what Plato would have dreamed of when he was thinking to the ideal city.
When he wrote: “No one can enter unless you master Geometry” above his academy, the goal was to be sure that people could reason and organise their thoughts before learning Philosophy.
Well, controlling the flow of your program is exactly the same, actually it’s even better.
Your computer doesn’t have a beard nor human characteristic that could make you feel daunted.
Unless you are scared by these dummy machines, you shouldn’t be afraid of making mistakes to LEARN.
Control Structures Flavor 1
The first kind of control structures is conditionals.
What if you want this?
Can you vote if you are under 18?
There are many situations in the daily life where YOU face or make conditional statements.
In programming that’s the same.
Any time you want to modify the execution flow of your code according to certain conditions you will use an if statement.
Everything is detailed directly on Google Colab.
Control Structures Flavor 2
Computers are absolutely dumb but they are never tired, they can work endlessly on that same repetitive task…
This process of repeating over and over is called iteration.
Here we are, this is the second control structure, iterative structure also known as loop.
Loops are very powerful AND dangerous.
It’s precisely for that reason that Satoshi Nakamoto (Bitcoin’s mysterious creator) decided to NOT allow Bitcoin’s programming language to use it.
With loops you can turn a single line of code into a million executioners.
Let’s taste those two flavors hands on code, click the link.
Conclusion
As usual, if you have any constructive criticism, question or remark, let me know in the comments.
Thanks for reading and see you tomorrow.