Beginner Coding Cheat Sheet (Python-
Friendly)
1. Variables & Data Types
int (integer) — Example: x = 10
→ Whole numbers without decimals.
float — Example: pi = 3.14
→ Numbers with decimals.
str (string) — Example: name = "Anna"
→ Text surrounded by quotes.
bool (boolean) — Example: is_active = True
→ Only two values: True or False.
list — Example: fruits = ["apple", "banana"]
→ Ordered, changeable collection.
tuple — Example: coords = (1, 2)
→ Ordered but unchangeable collection.
dict — Example: person = {"name": "Lee", "age": 22}
→ Key-value pairs.
None — Example: x = None
→ Means "nothing" or "no value".
2. Operators
Arithmetic — +, -, *, /, %, **
→ Math operations: add, subtract, etc.
Assignment — =, +=, -=
→ Set or update a variable’s value.
Comparison — ==, !=, >, <, >=, <=
→ Compare values (returns True or False).
Logical — and, or, not
→ Combine or reverse boolean expressions.
3. Control Flow
Sequential — Example: Code runs top to bottom
→ Default behavior of scripts.
If Statement — Example: if x > 5:
→ Runs code if condition is True.
Elif / Else — Example: elif, else
→ Other options when if is False.
For Loop — Example: for i in range(5):
→ Repeats code for each item in a sequence.
While Loop — Example: while x < 10:
→ Loops until condition becomes False.
break — Example: break
→ Exits loop early.
continue — Example: continue
→ Skips rest of current loop iteration.
4. Functions
Define Function — Example: def greet():
→ Create reusable blocks of code.
Call Function — Example: greet()
→ Run the function.
Parameters — Example: def greet(name):
→ Input to the function.
Return — Example: return "Hi"
→ Sends a value back from the function.
5. Collections
List — Example: colors = ["red", "blue"]
→ Ordered, changeable data.
Tuple — Example: sizes = (10, 20)
→ Like a list, but fixed.
Set — Example: nums = {1, 2, 3}
→ Unordered, no duplicates.
Dict — Example: user = {"name": "Kai"}
→ Key-value data storage.
6. Useful Terms & Slang
Bug — Error in the code.
Debug — Finding and fixing bugs.
Syntax — Rules of writing code (punctuation, structure).
Comment — # this is a comment – ignored by the program.
Script — A file containing code (e.g., main.py).
Hardcode — Manually inserting values instead of making code flexible.
Loop through — Go through each item in a list or collection.
Crash — Code stops unexpectedly due to an error.
Runtime — The period when your code is actively running.
7. Common Built-in Functions (Python)
print() — Displays output.
input() — Gets user input as a string.
len() — Returns length of a collection.
type() — Tells you the type of a variable.
range() — Generates a sequence of numbers.
str(), int(), float() — Converts types.
8. Common Acronyms
IDE — Integrated Development Environment (e.g., VSCode)
OOP — Object-Oriented Programming (coding with objects)
API — Application Programming Interface (bridge between programs)
JSON — JavaScript Object Notation (text format for data)
CLI — Command Line Interface (text-based input/output)
CRUD — Create, Read, Update, Delete – common in databases
HTML/CSS — Web structure and style (not Python, but often related)
9. Execution & Environment Terms
Kernel — The core process that runs your code in environments like Jupyter Notebooks.
It executes commands, manages memory, and returns results.
Interpreter — A tool that reads and runs your code line by line.
Runtime — The period when your code is actively running.
Shell — A command-line interface that lets you interact with your system (e.g., Python
shell, Bash).
10. Primitive Constructs
Variables — Containers for storing data values (e.g., x = 5).
Data Types — Types of data like int, float, string, bool.
Operators — Symbols used to perform operations on values (e.g., +, -, ==).
Functions — Reusable blocks of code that perform a task (e.g., def greet():).
Control Structures — Direct flow of execution (e.g., if, for, while).
Arrays / Lists — Ordered collections of items (e.g., [1, 2, 3]).
Pointers (not in Python) — Variables that store memory addresses, common in C/C++.
Python handles memory references automatically.