logo
01

Introduction to Python

⏱️ 15 min

Python Intro: Turning Your First Idea into Runnable Code

python_colab

What You Might Be Wondering

"I've never written code before. Can I actually do this?"

Yes. This lesson has one job: prove to yourself that you can type something and the computer will do what you said.

One-Line Definition

Python is a programming language that turns your thinking into step-by-step instructions a computer can execute.

Real-Life Analogy

Think of it like ordering food:

  • You write code = place an order
  • The interpreter runs it = kitchen cooks it
  • Output = food arrives at your table

Clearer orders, more predictable results.

Minimal Working Example

print("Hello, Python!")
name = "JR Student"
print(f"Welcome, {name}!")

Line-by-Line Breakdown

  • print("Hello, Python!"): outputs text to the screen
  • name = "JR Student": stores a string in a variable called name
  • print(f"Welcome, {name}!"): inserts the variable's value into the text, then prints it

Why This Lesson Matters

Every single topic after this — variables, functions, APIs, AI — depends on the same fundamental chain: input -> execute -> output.

Get this working now, and nothing later will feel like hieroglyphics.

Quick Quiz (3 min)

  1. Change name to your own name.
  2. Add goal = "I want to use Python to..." and print it.
  3. Deliberately write Print instead of print, read the error, then fix it.

Quiz Rubric & Grading Criteria

  • Direction: write runnable code that covers the core requirements and edge cases from the prompt.
  • Criterion 1 (Correctness): main flow produces correct results, key branches execute.
  • Criterion 2 (Readability): clear variable names, no excessive nesting.
  • Criterion 3 (Robustness): basic protection against empty values, type errors, or unexpected input.

Take-Home Task

Write a 3-line self-introduction program:

  • Your name
  • Current job/role
  • Why you're learning Python

Acceptance Criteria

You can independently:

  • Type and run your first Python code
  • Explain what "variable" and "output" each do
  • Read a simple error message and fix the problem

Common Errors & Debugging Steps (Beginner Edition)

  • Error message looks like gibberish: read the last line for the error type (TypeError, NameError, etc.), then trace back to the offending line.
  • Not sure what a variable holds: drop a temporary print(variable, type(variable)) to check.
  • Changed code but nothing happened: make sure you saved the file, you're running the right file, and your terminal environment (venv) is correct.

Common Misconceptions

  • Misconception: you need to understand advanced concepts in lesson one.

  • Reality: the goal here is "get it running and build confidence." That's it.

  • Misconception: getting an error means you're not cut out for programming.

  • Reality: errors are feedback, not a verdict on your abilities.