Python Basics
Python Basics
Section titled “Python Basics”This page is a compact orientation to the language. It does not replace the chapter-style pages, but it gives you the right mental model before you go deeper.
What Makes Python Feel Different
Section titled “What Makes Python Feel Different”Compared with many other mainstream languages, Python emphasizes:
- readability over punctuation-heavy syntax
- indentation as part of block structure
- quick iteration in scripts, shells, and notebooks
- a standard library that covers common tasks out of the box
Core Syntax You Meet First
Section titled “Core Syntax You Meet First”Variables and values
Section titled “Variables and values”name = "Ava"count = 3price = 19.99active = TruePython variables are names bound to objects. You do not declare the type ahead of time.
Collections
Section titled “Collections”numbers = [1, 2, 3]point = (10, 20)user = {"name": "Ava", "role": "admin"}tags = {"python", "api", "automation"}Conditionals and loops
Section titled “Conditionals and loops”if count > 0: print("positive")else: print("zero or negative")
for number in numbers: print(number)Functions
Section titled “Functions”def greet(name: str) -> str: return f"Hello, {name}"Python Habits Worth Learning Early
Section titled “Python Habits Worth Learning Early”- use virtual environments per project
- prefer
python -m pipwhen you want the interpreter and package manager to match - keep scripts small and focused
- name things clearly instead of over-compressing the code
- add type hints when they improve clarity
The Topics That Matter Next
Section titled “The Topics That Matter Next”Once you understand the basics, the next useful layers are:
- data structures
- functions and modules
- exceptions and file handling
- classes and object design
- packaging, environments, and tooling