Python
Completed
-
Section 1: Getting Started
-
Section 2: Core Syntax and Data Types
-
Section 3: Collections
-
39: Set Operations: Union, Intersection, Difference
-
Section 4: Control Flow
-
Section 5: Functions
-
Section 6: Turtle Graphics and Early Practice Projects
-
Section 7: Working with Files and I/O
-
Section 8: Regular Expressions
-
Section 9: Object-Oriented Python
-
Section 10: Error Handling
-
Section 11: Modules and Packages
-
Section 12: Iterators, Generators, and Functional Tools
-
Section 13: Decorators and Metaprogramming
-
Section 14: Concurrency and Parallelism
-
Section 15: Working with Dates, Times, and Numbers
-
Section 16: Standard Library Deep Dive I: Data Structures
-
Section 17: Standard Library Deep Dive II: System and Introspection
-
Section 18: Standard Library Deep Dive III: Security and Encoding
-
Section 19: Standard Library Deep Dive IV: Text and Data Utilities
-
Section 20: Networking and Web Basics
-
Section 21: Working with Databases
-
Section 22: Testing and Quality
-
Section 23: Advanced Typing
-
Section 24: Context Managers and Resource Handling
-
Section 25: Text, Unicode, and Binary Data
-
Section 26: More Functional and Iteration Tools
-
Section 27: Data Validation and Configuration
-
Section 28: Working with Images and Media
-
Section 29: Property-Based and Documentation Testing
-
Section 30: Packaging and Deployment
-
Section 31: Performance and Internals
-
Section 32: Design Patterns in Python
-
Section 33: GUI Programming
-
Section 34: Security Basics
-
Section 35: Data Structures and Algorithms
-
Section 36: Practical Projects
-
Section 37: Capstone Projects
-
Section 38: Interview and Algorithm Practice
-
Section 39: Writing Idiomatic Python
1: Installing Python on Windows, macOS, and Linux
A few years ago, I spent an entire afternoon helping a junior developer who was convinced that Python was "broken." He had followed a tutorial, installed the language, and yet every time he tried to use a modern feature like f-strings, his terminal screamed at him with a SyntaxError. The mystery? He was on a Mac, and when he typed python, the system was launching the ancient version 2.7 that Apple had bundled with the OS for a decade, rather than the version 3.11 he had just installed. He wasn't failing at coding; he was just talking to the wrong version of Python.
This is the "environmental hurdle." Before you write a single line of logic, you have to ensure your computer actually knows where the Python interpreter lives and which version should take priority. It sounds trivial, but path conflicts are the primary reason beginners quit in the first hour.
Handling the Windows Installation Trap
Windows is generally straightforward, but there is one single checkbox that will save you hours of frustration. When you run the installer from python.org, you'll see a small box at the bottom that says "Add Python to PATH." Check it. Seriously, do not skip this.
If you don't check that box, Windows won't know what the command python means when you type it into the Command Prompt or PowerShell. I've had to help countless devs manually edit their Environment Variables—a tedious process involving deep-diving into System Properties—just because they missed that one click. Once you've checked the box and finished the installation, you can verify it's working by opening a terminal and typing:
python --version
If it returns something like Python 3.12.x, you're golden.
Avoiding System Python on macOS
As I mentioned in that story about my junior dev, macOS can be tricky because it often comes with a pre-installed version of Python used by the operating system itself. You should almost never touch that system version; if you mess it up, you can actually break parts of macOS.
The professional way to handle this is via Homebrew. If you don't have Homebrew installed yet, it's the unofficial package manager for Mac and a lifesaver. Once Homebrew is set up, you just run brew install python. This installs a separate, clean version of Python 3 in a directory that doesn't interfere with the system files. One quirk to remember: on Mac, you might need to use the command python3 instead of just python to ensure you aren't accidentally calling that old system version.
Managing the Linux Pipeline
If you're on Linux, you're likely already in a Python-friendly environment. Most distributions (like Ubuntu or Fedora) come with Python pre-installed. However, the version in the default repositories is sometimes a few months behind the latest release.
I usually recommend using the built-in package manager. On Ubuntu or Debian, that's apt. You'll want to run sudo apt update and then sudo apt install python3. Like macOS, Linux almost always distinguishes between the versions. If you type python and get a "command not found" error, try python3. It's a common point of confusion, but it's just the OS's way of making sure it doesn't overwrite legacy scripts that might still rely on Python 2.
📋 Practical Task
Verifying the Python Interpreter Path
Now that you've installed Python, let's make sure your computer is pointing to the correct installation and not a hidden system version. We are going to write a tiny script that asks Python to tell us exactly where it is located on your hard drive.
Create a file named where_am_i.py and enter the following code:
import sys
print("The Python interpreter is located at:")
print(sys.executable)
Run this script from your terminal using python where_am_i.py (or python3 where_am_i.py).
Your Goal: Note the output path. If you are on Windows and the path includes AppData\Local\Microsoft\WindowsApps, you might be using the Windows Store shim. If you are on Mac and the path is /usr/bin/python, you are likely using the system version and should revisit the Homebrew installation steps to avoid future permission errors.
There are no comments for now.