Python Fundamentals
Introduction to Python & Setup
Python is a high-level, interpreted, general-purpose programming language created by Guido van Rossum, first released in 1991.
Jr Codex Python Notes
Level: Beginner Prerequisites: None Time to complete: ~20 minutes
Table of Contents
- What is Python?
- Why Python is So Popular
- Installing Python
- Ways to Run Python Code
- Your First Program
- Choosing an Editor
- Summary & Next Steps
1. What is Python?
Python is a high-level, interpreted, general-purpose programming language created by Guido van Rossum, first released in 1991.
"High-level" → You write code close to human language, not machine instructions.
"Interpreted" → Code runs line-by-line via an interpreter, no separate compile step.
"General-purpose" → Not tied to one domain — web, data, AI, scripting, automation, all fit.
Compared to a lower-level language like C, Python trades some raw speed for a massive gain in readability and development speed:
# Python — reads almost like English
name = "Alice"
print(f"Hello, {name}!")// C — same idea, far more ceremony
#include <stdio.h>
int main() {
char name[] = "Alice";
printf("Hello, %s!\n", name);
return 0;
}2. Why Python is So Popular
| Reason | Explanation |
|---|---|
| Readable syntax | Uses indentation instead of {}, minimal boilerplate |
| Batteries included | Huge standard library (files, math, dates, networking...) |
| Huge ecosystem | pip gives access to 500,000+ third-party packages |
| Cross-domain | Web (Django, Flask), Data (pandas, NumPy), AI (PyTorch, transformers) |
| Beginner-friendly | Gentle learning curve, used as a first language at most universities |
This is exactly why the rest of the Jr Codex curriculum — Machine Learning, Deep Learning, and NLP/LLMs — is built entirely on Python.
3. Installing Python
Windows
- Download the installer from python.org/downloads.
- Important: check "Add python.exe to PATH" during install.
- Verify in a terminal:
python --version
# Python 3.12.xmacOS / Linux
Python 3 often comes pre-installed, but it's usually outdated. Recommended: install via a version manager.
# macOS (Homebrew)
brew install python3
# Linux (Debian/Ubuntu)
sudo apt update && sudo apt install python3 python3-pipVerifying pip (Python's package manager)
pip --version
# pip 24.x from ... (python 3.12)4. Ways to Run Python Code
There are three common ways to execute Python, and you'll use all three throughout this course.
| Method | Use Case |
|---|---|
| REPL (interactive shell) | Quick experiments, testing one-liners |
Script file (.py) | Real programs, reusable code |
Notebook (.ipynb) | Data exploration, mixing code with notes/plots (used heavily in later ML/DL modules) |
The REPL
Type python in your terminal to enter the Read-Eval-Print Loop:
$ python
>>> 2 + 2
4
>>> print("testing")
testing
>>> exit()Running a Script
# hello.py
print("Hello from a script!")$ python hello.py
Hello from a script!Jupyter Notebooks
pip install notebook
jupyter notebookThis opens a browser-based environment where you run code in cells — the standard tool for data science work later in this curriculum.
5. Your First Program
Create a file named greet.py:
# greet.py
def greet(name):
"""Return a friendly greeting."""
return f"Hello, {name}! Welcome to Python."
if __name__ == "__main__":
user_name = input("What's your name? ")
print(greet(user_name))Run it:
$ python greet.py
What's your name? Alice
Hello, Alice! Welcome to Python.Don't worry about understanding def or if __name__ == "__main__" yet — functions are covered fully in Module 2. For now, just get comfortable running files.
6. Choosing an Editor
You don't need anything fancy to start:
| Tool | Best For |
|---|---|
| VS Code | Most popular, free, great Python extension |
| PyCharm | Full-featured IDE, strong for larger projects |
| Jupyter/Colab | Data science, notebooks, no local setup (Colab runs in-browser) |
Recommendation for this course: VS Code with the official Python extension — it's what most of the code examples in later chapters assume.
7. Summary & Next Steps
Key Takeaways
- Python is a readable, interpreted, general-purpose language — the foundation for every later module in this curriculum (ML, DL, NLP/LLMs).
- You can run Python via the REPL (quick tests), scripts (
.pyfiles), or notebooks (.ipynb, used in data science work). pipis Python's package manager — you'll use it constantly starting in Module 3.
Concept Check
- What does "interpreted" mean, and how is it different from a "compiled" language?
- Name the three ways to run Python code covered in this chapter.
- What command checks your installed Python version?
Next Chapter
→ Chapter 2: Variables, Data Types & Type Conversion
Jr Codex — 1-on-1 Personalized Coaching | Back to Module Index