DynamicVibePython learning
How to study · reference & help

One lesson at a time

Read the idea, then follow the named exercise steps. On a phone, use Idea, Code and Output to switch views. Review days begin with recall before the rebuild. A self-review mark is not a scored answer.

Run, inspect, repair

Run loads Python in your browser on the first use, so you need an internet connection. Read Output and the check result. Stop interrupts a run; it keeps your code. Reset restores the selected starter, replacing that exercise’s draft. Use an authored hint before asking for help.

Keep your work

Code drafts, progress and Notes save on this device when browser storage is available. They do not sync through your login. Use Backup & records above to download saved learning records, preview an import or undo the latest import. Copy unsaved text first; clearing browser data can remove local work. A save warning means you should copy your work before leaving.

Practice files and reports

Each browser Run starts in a fresh temporary workspace. A sample file exists only when that run’s code creates it; these are not your computer’s files. On report tasks, use Preview to inspect the actual text and Download to request a copy before another Run, Reset, exercise change or leaving. Reports do not save through tutor login. Read files and write reports.

Get tutoring when you need it

Lessons and checkpoints do not need tutor login. Unlock the tutor through Training’s shared tutor access, then use its return link to come back here. Your question is only sent when you press Send. Do not paste passwords or private production data.

Python words in plain language

Assignment and type
frames = 96 binds a name to an integer. "96" is text, not the same numeric value. Values and names.
List and index
A list keeps items in order. Positions start at zero; the final nonnegative index is length minus one. List lookups.
Loop and indentation
A for loop processes each item. Indentation groups its repeated statements; a statement outside the block runs separately. Loops.
Parameter, argument and Return
A parameter names an input in a definition; an argument supplies its value in a call. Return gives a result to the caller; print displays it. A function that only prints returns None. Functions.
Dictionary and schema
A dictionary labels values with keys. A schema states the required fields and types; a missing fact is not automatically zero. Dictionaries · Validation.
File, CSV and JSONL
A file stores bytes/text. CSV needs a quoting-aware parser; JSONL contains one JSON value per line. Browser practice files are temporary, not computer files. CSV · JSONL.
Denominator and evidence
A rate divides a count by its declared eligible total. Keep exclusions visible. A quiz score, practical check and self-review are different evidence. Quality rates.

Read the error, then make one repair

SyntaxError / IndentationError
Python could not parse the code. Inspect the named line and the preceding line for a missing colon, unmatched quote/bracket or inconsistent indentation. Review blocks.
NameError
A name has no value here. Compare case and spelling, and check that assignment happens before use. Do not replace an unknown parameter with a fixed sample.
TypeError / ValueError
A wrong kind of value or an unacceptable value can fail an operation. Inspect the supplied input and declared policy; do not broadly suppress the error. Narrow error handling.
IndexError / KeyError
The requested position or key is missing. Inspect the collection and interface instead of guessing a fallback. Indices · Keys.
Run stays loading / runtime or checker unavailable
This is not proof that your answer is wrong. Stop if available, copy your draft, check your connection and retry. If it repeats, keep the visible error and use the readable lesson/hints. Never reset or clear browser storage as the first repair.
Expected sample prints, but a check fails
Read the named contract and test changed/empty inputs. The helper may return None, use a fixed value or stop too early even when the sample looks right. A failed check is not a request to copy the expected output.

Press Escape while working inside this panel to close it and return focus to its summary. Without JavaScript, use the summary again. For local Studio commands, use terminal troubleshooting.

← Route Week 1 · Day 5 · Checkpoint

Review

Loading today's steps…
Lesson idea Tap to fold
Recall — one from each day

Answer all four before you look. Each answer is behind its own disclosure.

Day 1. What does = do in frame_count = 240?

Show the answer

It puts 240 into the box labelled frame_count. Right side into left side.

Day 2. In a three-item list, which number in square brackets gets you the last item?

Show the answer

[2]. Counting starts at zero, so the third item is two steps in.

Day 3. What tells Python which lines are inside a loop?

Show the answer

The indent — the four spaces at the start of the line.

Day 4. What is the difference between print and return?

Show the answer

print shows something on screen. return hands a value back so it can be used.

Today

Rebuild, repair and transfer

Your outcome: Combine variables, lists, loops and returning functions, then solve a new collection calculation.

Begin with recall before opening comparisons. Knew it and Looked it up are your own reports, not scored correct answers. The quiz and coding checks record separate evidence.

The guided ingest example uses all four ideas: def creates the helper, clips stores an ordered list, for visits each clip, and the indented call prints a returned string. Trace one call before tracing the whole list.

For a collection total, start a variable at zero. total = total + value computes the next total from the previous one. Keep the update inside the loop; return the total after the loop. On empty input, the update never runs, so the initial zero remains.

The worked accumulator below totals frame counts. Your new transfer task totals seconds at a declared 24 fps instead. Write your own conversion and explain what happens for an empty list. No validation or media decoding is required: the supplied task inputs are nonnegative integer frame counts.

# Rebuild, repair and transfer
def ingest_line(clip):
    return "Ingested " + clip

clips = ["harbour.mov", "rooftop.mov"]
for clip in clips:
    print(ingest_line(clip))

def total_frames(values):
    total = 0
    for value in values:
        total = total + value
    return total

print(total_frames([48, 72]))

Trace: The loop prints Ingested harbour.mov and Ingested rooftop.mov. In total_frames, total changes from 0 to 48 to 120, then 120 returns after both values. Returning inside the loop would stop after the first value.

Keep a private explanation of changed inputs and any help used. A quiz pass or a repaired sample is not an independent transfer result.

Predict, explain, then test

Answer before opening the comparison. These brief answers are self-reviewed, not quiz scores. Task labels describe the brief, not proof that you worked without assistance. Record any examples, hints or tutor help in your own Notes.

Predict

What does total_frames([]) return?

Compare your answer · self-reviewed

0. The loop has no items, so the initial total reaches return unchanged.

Explain

Why does return inside the for block only process the first item?

Compare your answer · self-reviewed

return ends the function call immediately. Put the final return after the loop so every item contributes.

Repair

The repair helper uses count instead of its frames parameter. Why is changing it to 96 not enough?

Compare your answer · self-reviewed

A fixed value cannot handle other calls. Use frames and then test zero and a different positive count.

Independent transfer: total new clip durations

Write total_seconds(frame_counts) with a for loop. Supplied inputs are lists of nonnegative integer frame counts, all at a declared 24 fps. Return the numeric sum of their durations; [] returns zero. Do not mutate the input, print inside the helper or return a fixed sample. Keep both sample calls. Explain your running total and why return belongs after the loop.

Select this final task in the controls. The quiz link selects the unfinished starter without running it. Review loops and indentation and parameters and return if needed.

Read the unfinished starter without running Python
# Return a combined duration from the supplied counts.
def total_seconds(frame_counts):
    # Accumulate each duration, then return after the loop.
    return None

# Observe changed and empty collections.
print(total_seconds([48, 72]))
print(total_seconds([]))

Sample duration is 5 seconds, then zero for the empty list. Numeric display may include .0. Checks also use a longer list, zero counts, half-seconds and a fractional result; a print replay or returning after the first item fails. Keep a private explanation of the total after each iteration. Knowledge and practical evidence stay separate.

Now

Choose an exercise to load its prompt.

Keep going — optional

No new idea today, so nothing to pair it with. If the week stuck and you want more, the official tutorial keeps going from exactly where variables, lists, loops, and functions leave off.

day-5.py standard Python · runs in this browser
Output

Loading exercises…


    
    

Section 1 checkpoint

The scored checkpoint loads with JavaScript. The readable recall questions and coding practice above remain available without it. Knowledge scores and practical checks are recorded separately.

AI Tutor

The tutor mounts here when JavaScript is available. The lesson above stays readable without it.