The beginner-friendly guide to coding like a pro.
Python is a high-level language, which means it reads almost like English. It's used by **NASA**, **Netflix**, and **Spotify**. If you can write a recipe for a sandwich, you can write Python!
Think of your computer as a car. The icons and mouse are the steering wheel, but the Terminal is the engine. It's a text-based window where you give direct commands to the computer.
Google Colab Tip: In Colab, you don't need a terminal window. Each "Code Cell" acts like a mini-terminal!
In English, we use periods and capital letters. In Python, the most important rule is Indentation. It's how Python knows which lines of code go together.
:, the next line MUST have a big gap (4 spaces or 1 Tab).
Imagine you have boxes and you put labels on them. That's a variable!
| Code | What it means |
|---|---|
player_name = "Alex" |
Stores text (called a String) |
score = 100 |
Stores a whole number (called an Integer) |
is_game_over = False |
Stores a Yes/No value (called a Boolean) |
Use the # symbol to write notes. Python will ignore everything after it. Itβs like leaving a "Post-it" note on your code.
Open a new notebook and type your first print() function!