Smart Machines
Teaching computers how to learn. This is how things like face unlock and chatbots are built.
Python is a tool that lets you give instructions to a machine. Instead of typing complex math or confusing symbols, you type words that look almost exactly like normal English.
# This tells the computer to show a message print("Hello, getbetterat.work!") # This does simple math score = 10 + 5 print(score)
Python is famous because it can do almost any job. Here are the main four.
Teaching computers how to learn. This is how things like face unlock and chatbots are built.
Taking millions of numbers and turning them into simple charts so people can make good choices.
Writing a short script to do boring, repetitive clicking or typing for you automatically.
Building the hidden engine that runs big websites. It handles logins, saving pictures, and messages.
You write simple instructions in a text file.
Python reads your words and translates them into machine code on the spot.
The computer understands the translated code and does exactly what you asked.
Look at the difference. Both boxes do the exact same job: telling the computer to say "Hello".
#include <iostream>
int main() {
std::cout << "Hello" << std::endl;
return 0;
}
print("Hello")
Python is powerful because you do not have to build everything from scratch. Millions of people have already built free tools for you to use. These tools are called "Libraries".
A tool that turns messy numbers into neat tables, like a super-powered spreadsheet.
A kit that gives you all the parts needed to build a huge website quickly.
A set of parts to help you draw shapes on a screen and build your own video games.
A heavy-duty tool built by Google to help computers recognize pictures and human voices.
Perfect for a single file that just renames all the photos on your computer in one second.
A program with multiple files that checks the weather every morning and sends you a text message.
Massive systems with millions of users. (Instagram and Spotify use Python to run their apps).
A variable is just a box with a name on it. You can put data inside the box to save it for later.
This is how the computer makes choices. "If it is raining, take an umbrella. Else, wear sunglasses."
Telling the computer to do the exact same thing over and over again without getting tired.
x or stuff. Nobody will know what is
inside them.
user_age or total_price.
#
symbol to write notes in plain English so you remember what the code does later.
Just like food comes in different flavors, data comes in different types. Python needs to know exactly what it is looking at so it doesn't try to multiply a word by a number.
Just normal words wrapped in quote marks.
"Hello World"
Normal math numbers with absolutely no decimals.
42
Numbers used for exact measurements, like money.
19.99
A simple electronic switch. Yes or No. True or False.
True
Sometimes you need to store many things at once. Instead of building 100 different boxes, you build one "List" that holds everything in perfect order.
cart = ["Apple", "Bread", "Milk"] # Pick the first item # (Computers start counting at 0) print(cart[0]) # The screen will say "Apple"
A "Dictionary" is a filing cabinet where every single piece of data gets a clear label attached to it. This way, you never forget what the numbers actually mean.
If you have to do the exact same task 50 times a day, you shouldn't write the code 50 times. You write it once, save it as a "Recipe", and just call its name whenever you need it.
Teach the computer the steps.
def make_coffee():
print("Grind beans")
print("Add water")
Just shout the name of the recipe.
make_coffee()
make_coffee()
You do not have to be a math genius to code. If you need to roll a random dice, someone else already wrote the complex code for it.
You just have to borrow it using the magic word: import.
When you make a typo, the screen spits out angry red text. Beginners panic and quit. Professionals know this is just the computer trying to help you find your typo.
Translation: "Hey! I tried to run your code, but you forgot to put a colon (:) at the end of line 4. Just type it in and I will try again!"
You can write Python in regular Notepad, but it won't highlight your spelling mistakes or help you write faster.
A free, super-smart notebook by Microsoft. It highlights your text in bright colors so it is extremely easy to read.
You can even write Python directly on websites without downloading anything at all. Great for quick tests.
Coding is an open-book test. Nobody memorizes everything. If you don't know how to do something, you ask Google.
A website called Stack Overflow has answers to almost every Python question ever asked. Using Google is a required professional skill.
If you type import this into
Python, it prints a secret poem created by the founders. Here are the three most important rules you
must always follow:
Python is not just a toy. It is the core engine behind the highest-paying jobs in the world right now.
Companies give you thousands of messy spreadsheets, and you use Python scripts to organize them and find out how they can make more money.
You build the invisible engines behind mobile apps so that millions of users can log in, save their photos, and buy items securely.
You feed massive amounts of books, math, and images into Python programs so the computer slowly learns how to talk or act like a human.
Python is just a set of instructions. Start with simple words, build small tools, and eventually, you will be able to build systems that change the world.