PYTHON FUNDAMENTALS: PROGRAMMING FOUNDATIONS / L01PYTHON SETUP AND FIRST STEPS
LESSONS · 12 · 01 / 12
LESSON 01 · BEGINNER · 45 MIN · ◆ 2 INSTRUMENTS

Python Setup and First Steps

Get Python running and write your first programs. Learn about the Python ecosystem and interactive development.

TIP

Learning Objectives: After this lesson, you'll understand what Python is, why it's popular, and be able to write and execute your first Python programs using interactive tools.

What is Programming? A Chef's Perspective

Programming is like writing recipes for a very literal robot chef. Your code is the recipe, Python is the chef that follows it exactly, your data is the ingredients, and the output is the dish. The catch: the chef has zero common sense.

Assemble the recipe below and run the robot. Make a step vague, reorder the steps, or empty the pantry — and watch precisely where it breaks.

FIG. 02Literal Robot Chef
INTERACTIVE
LOADING INSTRUMENT
Fig. 02Assemble a recipe and run a literal robot — vague steps, wrong order, or a missing ingredient visibly break it.

A good recipe — and a good program — has to be precise (exact amounts), sequential (the right order), unambiguous (no "stir until done"), and complete (nothing missing). Break any one of these and the robot stalls. That's all programming really is: precise, unambiguous instructions a literal machine can follow.

What is Python?

Python is a high-level, interpreted programming language known for its simplicity and readability. Created by Guido van Rossum in 1991, Python has become one of the most popular programming languages in the world.

Why Python is like a friendly chef:

  • It understands instructions written in near-English
  • It gives helpful error messages when confused
  • It handles many technical details automatically
  • It's forgiving for beginners but powerful for experts

Why Python is Special

FeatureDescriptionExample
Simple SyntaxCode reads like Englishif age >= 18: print("Adult")
InterpretedNo compilation neededRun code immediately
VersatileWeb, data science, AI, automationDjango, pandas, TensorFlow
Large CommunityExtensive libraries and support300,000+ packages on PyPI

Your First Python Program

print() is how Python shows output. The classic first line is print("Hello, World!") — here it is, plus a couple more lines so you can see print() handle text and math. Press Run, then change something and run again — it's yours to edit:

FIG. 04Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 04Interactive Python code execution environment

🎉 Congratulations! You just ran your first Python program. Notice how:

  • print() displays text and values
  • Text (strings) are wrapped in quotes
  • Python can do math calculations
  • Comments start with #

Python as a Calculator

Python excels at mathematical operations. Try these examples:

FIG. 06Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 06Interactive Python code execution environment

Working with Text

Python makes it easy to work with text (called "strings"):

FIG. 08Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 08Interactive Python code execution environment

Python's Philosophy

Python has a famous design philosophy, "The Zen of Python." A few principles that shape the language:

  • Beautiful is better than ugly - Code should be pleasant to read
  • Simple is better than complex - Prefer straightforward solutions
  • Readability counts - Code is read more often than written

Common Python Use Cases

Python is used everywhere in technology:

🌐 Web Development

  • Frameworks: Django, Flask, FastAPI
  • Companies: Instagram, Spotify, Dropbox

📊 Data Science & Analytics

  • Libraries: pandas, NumPy, matplotlib
  • Companies: Netflix, Uber, Airbnb

🤖 Artificial Intelligence

  • Libraries: TensorFlow, PyTorch, scikit-learn
  • Applications: ChatGPT, image recognition, recommendation systems

🔧 Automation & Scripting

  • System administration
  • Web scraping
  • Task automation

Your Development Environment

In this course, we're using an interactive Python environment that lets you:

  • ✅ Write and run code instantly
  • ✅ See results immediately
  • ✅ Experiment without setup
  • ✅ Learn through hands-on practice
FIG. 10Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 10Interactive Python code execution environment

Practice Exercises

Try these exercises to reinforce what you've learned:

Exercise 1: Personal Introduction

FIG. 12Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 12Interactive Python code execution environment

Exercise 2: Simple Calculator

FIG. 14Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 14Interactive Python code execution environment

Key Takeaways

Python is beginner-friendly - Simple syntax that reads like English
Interpreted language - Run code immediately without compilation
Versatile - Used in web development, data science, AI, and automation
Interactive - Perfect for learning and experimentation
print() - Your primary tool for displaying output
Comments - Use # to document your code

Connections: Programming Languages and Beyond

🔗 Connection to Other Programming Languages

Python is part of a large family of programming languages. Here's how it compares:

PythonJavaScriptJavaC++
print("Hello")console.log("Hello")System.out.println("Hello")cout << "Hello"
No compilationNo compilationCompiles to bytecodeCompiles to machine code
InterpretedInterpretedHybridCompiled
Dynamically typedDynamically typedStatically typedStatically typed

Python's Philosophy:

  • Readability: Code should be easy to read (unlike Perl)
  • Simplicity: One obvious way to do things (unlike C++)
  • Batteries included: Rich standard library (unlike C)

🔗 Connection to Computer Science

Python helps you learn fundamental CS concepts:

  • Algorithms: Step-by-step problem solving
  • Data structures: Organizing information efficiently
  • Logic: Boolean reasoning and decision making
  • Abstraction: Hiding complexity behind simple interfaces

🔗 Connection to Your Future Learning

This is just the beginning of your Python journey:

  • Next lesson: Variables and data types (your program's memory)
  • Soon: Functions and classes (organizing your code)
  • Later: Web development, data science, or AI (applying Python)
  • Eventually: Building your own applications and tools!

Remember: Every expert programmer started exactly where you are now - with print("Hello, World!")!

Next Steps

In the next lesson, we'll dive deeper into variables and data types - the building blocks of all Python programs. You'll learn how Python stores and manages different types of data in memory.


Ready to continue? The next lesson will show you how Python handles data with variables and introduce you to Python's built-in data types.


Further Reading

Interactive Playgrounds

Official & Free Books

Modern Tooling (use these, not the old pyenv/virtualenv dance)

  • uv — Astral's modern Python package + project manager. Drop-in replacement for pip, pip-tools, pyenv, poetry. Written in Rust, ~10× faster.
  • Ruff — formatter + linter that replaces black, flake8, and isort in one tool. Also from Astral.
  • VS Code Python Extension — the most popular Python editor setup, with the official tutorial.

Video & Community

CONNECTED CONCEPTS
pythonsetupbasicshello-world