Week 1 of 16

First Code

Install Python, write three programs, and finish the day with something that actually runs

Day 1 60 minutes Setup + Build

Day 1 of 80

The 5 Patterns — Everything This Week Is Built From These
Pattern What it does Example
print(...) Shows something on screen print("Scene 1")
name = value Stores something platform = "Kling"
input(...) Asks the user something input("Project name: ")
f"...{var}..." Inserts a variable into text f"Scene {scene}"
open(...) Reads or writes a file open("output.txt", "w")

You will not understand all of these today. That is fine. Recognition comes before understanding. Refer back to this table whenever something looks unfamiliar.

Not This Week — Intentionally Deferred

If you encounter any of these while searching for help, close the tab and move on. They are real Python — just not Week 1 Python.

classes decorators async / await virtual environments list comprehensions try / except lambda functions *args / **kwargs

What You'll Build Today

By the end of this session you will have written and run three programs:

  1. hello.py — proves Python is installed and working
  2. intro.py — variables and f-strings, DVP context
  3. formatter_v0.py — a hard-coded shot formatter, the seed of this week's project
How This Week Works

Every day this week you'll extend the same formatter script. By Friday it accepts real input, calculates runtimes, formats multiple shots, and saves to a file. You learn the concepts by needing them — not by studying them first.

Part 1: Install Python (10 min)

If Python is already installed and python --version works in your terminal, skip to Part 2.

  1. Download Python
    Go to python.org/downloads and click "Download Python 3.x.x".
  2. Run the installer
    Before clicking anything else: check "Add python.exe to PATH" at the bottom of the installer window. This single checkbox is the difference between it working and it not working.
    Check The Box

    The PATH checkbox is the #1 reason beginners hit "python is not recognized" errors. Check it. Then click Install Now.

  3. Verify
    Open the terminal in Cursor (Ctrl + `) and type:
    Terminal
    $ python --version
    Python 3.12.4
    Any version number means you're good. If you see an error, close the terminal and reopen it — it needs to reload PATH.

Part 2: Your First Program — hello.py

In Cursor, create a new file called hello.py in your Python Training folder. Type this — don't paste:

hello.pyPython
print("Python is working.")
print("Marc is learning Python.")
print("DVP tools incoming.")

print() is a function — a built-in tool that does a specific job. This one displays text. The text goes inside parentheses, wrapped in quotes.

If you know JavaScript: print() is Python's console.log(). Same idea, different name.

Run It

In the terminal: python hello.py

You should see three lines of output. If you get an error, read it — it tells you exactly which line has the problem. Fix it and run again.

Reading Error Messages

Errors are not failures. They're Python telling you exactly what went wrong and where. Every error message has three things: the file name, the line number, and a description. Learn to read them before Googling. The SyntaxError you'll hit most often as a beginner means Python can't parse what you wrote — usually a missing quote or bracket.

Part 3: Variables & F-Strings — intro.py

Create a new file: intro.py. A variable is a name that holds a value. You create one by writing name = value.

intro.pyPython
# Variables — names that hold values
your_name   = "Marc"
company     = "DynamicVibe Productions"
platform    = "Kling"
scene       = 1

# print() just shows the value
print(your_name)
print(platform)

# f-strings mix variables into text
# Put f before the opening quote, wrap variables in {curly braces}
print(f"{your_name} is building AI tools at {company}.")
print(f"Current platform: {platform} — Scene {scene}")

Variable naming rules: lowercase with underscores (your_name not yourName). Can't start with a number. No spaces. Names should say what the value is.

F-strings: The f before the quote tells Python "this string has variables in it." Anything in {curly braces} gets replaced with the variable's value. If you forget the f, you'll literally see {your_name} printed instead of "Marc".

JavaScript comparison: This is exactly like template literals: `${yourName} is building...`

Run It, Then Change It

Run python intro.py. Then change the variables to different values and run it again. Notice how the output changes without touching the f-string lines. That's the point of variables — write the formatting logic once, change the data.

Now Write One Yourself

Without looking at the code above, add three more lines to intro.py:

Write those lines yourself, from scratch. Then run the file. If you get an error, read the message and fix it.

Part 4: The Formatter Seed — formatter_v0.py

This is the project you'll grow all week. Today's version is simple: no user input, just hard-coded data. But the output looks real.

Try the Faded Version First

Fill in every ____ blank using the 5-pattern table at the top of this page. Don't look back at earlier code. Recognition first — solution second.

formatter_v0.py — fill in the blanksPython
# ── Project Info ─────────────────────
project = "____"
client  = "____"

# ── Shot Data ────────────────────────
scene1 = ____          # a number — no quotes
desc1  = "____"
plat1  = "____"

scene2 = ____
desc2  = "____"
plat2  = "____"

scene3 = ____
desc3  = "____"
plat3  = "____"

# ── Output ───────────────────────────
print(f"{'=' * ____}")
print(f"  {____.____()}")        # project name in ALL CAPS
print(f"  Client: {____}")
print(f"{'=' * ____}")
print()
print(f"  Scene {____}  [{____}]")
print(f"  {____}")
# ... repeat for scenes 2 and 3
formatter_v0.py — full solutionPython
# ── Project Info ─────────────────────
project = "Golf Course Commercial"
client  = "Highland Links"

# ── Shot Data ────────────────────────
scene1 = 1
desc1  = "Wide establishing shot, golf course at sunrise, drone pull-back"
plat1  = "Kling"

scene2 = 2
desc2  = "Slow motion swing at the 18th tee, shallow focus, film grain"
plat2  = "Runway"

scene3 = 3
desc3  = "Close-up of ball dropping into cup, sound of crowd reacting"
plat3  = "Veo"

# ── Output ───────────────────────────
print(f"{'=' * 44}")
print(f"  {project.upper()}")
print(f"  Client: {client}")
print(f"{'=' * 44}")
print()
print(f"  Scene {scene1}  [{plat1}]")
print(f"  {desc1}")
print()
print(f"  Scene {scene2}  [{plat2}]")
print(f"  {desc2}")
print()
print(f"  Scene {scene3}  [{plat3}]")
print(f"  {desc3}")
print()
print(f"{'=' * 44}")

New thing: {'=' * 44} inside an f-string. The * operator on a string repeats it. '=' * 44 gives you 44 equals signs. Using it inside a curly brace makes f-string evaluate it. Clean divider lines without typing 44 characters.

project.upper() — a method. A method is a function that belongs to a piece of data, called with a dot. .upper() returns the string in ALL CAPS. The original variable is unchanged.

Run It, Then Make It Yours

Run python formatter_v0.py. Then replace the hard-coded data with a real DVP project — or invent one. Change the project name, client, shots, and platforms. The output should look like something you'd actually send to a client.

How This Connects to Your Work

At xAI you evaluate AI outputs using structured forms — model name, prompt, quality score, notes. Those fields are just variables. The formatted records you submit are f-strings. The shot formatter you built today is structurally identical to an evaluation report: collect labelled data, format it consistently, output it. The only difference is the field names.

Every annotation platform you've ever used — whether it's an internal xAI tool or a third-party labelling interface — was built by someone who started exactly where you are today.

Try This at Work

xai_eval_v0.py — Build the same kind of formatter you made today, but shaped around an AI evaluation record instead of a shot list. Hard-code one fake evaluation session and print it as a structured report.

Your variables might look like:

evaluator   = "Marc"
model       = "Grok Aurora"
prompt      = "Wide shot of a mountain lake at sunrise, cinematic"
score       = 4
notes       = "Strong composition, slight motion blur on foreground rocks"

Print a formatted eval record — project name header, the prompt, the score, and the notes. Make it look like something you'd actually submit. This is formatter_v0 for your real job.

Did You Make It?

Floor — Minimum Pass

The day counts if you did this. One hard day doesn't break the course.

  • Python is installed and python --version prints something
  • You ran hello.py and saw three lines of output
Goal — Today's Target

What today was designed to achieve. This is the real pass.

  • Ran hello.py, intro.py, and formatter_v0.py
  • Changed the data in each to something real or personal
  • Can say in your own words what a variable is and what f does
Honors — Great Day

Only if Goal is fully done and you have time left.

  • Filled in the faded formatter_v0.py blanks before looking at the solution
  • Added a fourth shot to the formatter without prompting
  • Ran xai_eval_v0.py from the "Try This at Work" section
Tomorrow

You'll add input() to the formatter — instead of hard-coded data, it asks the user. You'll also learn every string method you'll actually use. By the end of Day 2, formatter_v1.py will accept real input from whoever runs it.

Optional: Video Supplement

If you want a second voice explaining what you built today, the first 30 minutes of Mosh's Python course covers the same ground. Not required — but useful if anything felt unclear.

Programming with Mosh — Python Full Course for Beginners

Watch the first 30 minutes only — covers variables, strings, and print()

Notes

Your local study notes mount here when JavaScript is available.

Protected AI Tutor

Teaching modes mount here when JavaScript is available. The readable course remains available without them.