Computer Fundamentals & Python
Understand how a computer executes code: CPU, RAM, disk, OS, and other components. Plus, learn Python's key characteristics with interactive visuals.
Core Components β Visual Overview
Click each unit to learn its role in executing instructions.
ALU
Math & Logic
Control Unit
Orchestrates
Registers
Instant access
Cache
L1/L2/L3
RAM is volatile β your Python variables live here while the program runs. It's ~100x faster than an SSD.
Hover over each level β the pyramid narrows at the top: faster but smaller.
Your .py files, Python interpreter, and libraries live on the disk permanently. They are copied to RAM when you run a program.
| HDD | SSD | |
|---|---|---|
| Speed | ~100 MB/s | ~500β7000 MB/s |
| Noise | Audible spinning | Silent |
| Durability | Fragile | Shock resistant |
The Operating System manages hardware and provides services to your Python code.
Process Mgmt
Memory Allocation
File System
I/O Handling
- GPU: Graphics & parallel processing (important for AI/ML)
- Motherboard: Connects all components
- Network Card: Enables internet and
pip install - BIOS/UEFI: Starts the computer and initializes hardware
π Journey of a Python Program
Click each step to reveal what happens when you run hello.py.
Disk β RAM
Lexer β AST
Compile to .pyc
Virtual Machine
Machine code
Result delivered
π Python β Why Developers Love It
π Interpreted
No compile step β run instantly.
π§© Dynamic Typing
No type declarations needed.
π HighβLevel
Focus on logic, not memory.
π Rich Standard Library
Batteries included!
π― ObjectβOriented
Everything is an object.
π CrossβPlatform
Write once, run anywhere.
π€ Indentation Matters
Clean code enforced.
π€ Open Source
Free & vast ecosystem.
βοΈ Python vs Other Languages
β‘ Execution Speed
Higher is betterπ Library / Ecosystem
Higher is better| Feature | Python π | Java β | C++ β‘ | JavaScript π |
|---|---|---|---|---|
| Typing | Dynamic | Static | Static | Dynamic |
| Best For | AI/ML, Data, Web | Enterprise, Android | Games, Systems | Web Fullstack |
| Learning Curve | Gentle | Moderate | Steep | Moderate |
Practice Problems
1. Check Your Python Version & OS
import sys, platform
print(f"Python: {sys.version}")
print(f"OS: {platform.system()} {platform.release()}")2. Demonstrate Dynamic Typing
x = 42; print(type(x))
x = "hello"; print(type(x))3. List Files Using os Module
import os
for item in os.listdir('.'):
print(item)