Good place to stop if you're short on time — step 3 picks up here.
Lesson idea Tap to fold
First lesson — nothing to recall yet. Start here.
Give a value a name
Your outcome: Create named text and integer values, change the stored count and print a readable slate.
Assignment evaluates the right side, then binds the name on the left to that value. Read clip_name = "Night Shift" as “name this text clip_name”, not as a comparison. A labelled box is a useful first picture, but names refer to values; they are not literal containers.
Quotes make a string (text). 240 without quotes is an integer; "240" is text. Variable names are case-sensitive and do not use spaces: clip_name and Clip_name are different names.
print displays its arguments. Commas separate the pieces and print inserts a space between them by default. The quotes are Python syntax, not characters printed around the clip name. Reassignment changes what that name refers to; earlier output does not change.
# Give a value a name
clip_name = "Night Shift"
frame_count = 240
print(clip_name, "·", frame_count, "frames")
frame_count = 300
print(frame_count)
Trace: First print: Night Shift · 240 frames. The next assignment binds frame_count to 300; the second print shows 300. The clip name did not change.
Keep data and display separate: create the declared values, then print them. For your own transfer, choose a different name and count and explain which assignment changes each output.
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
After frames = 48, then frames = frames + 24, what does print(frames) show?
Compare your answer · self-reviewed
72. Evaluate 48 + 24 before assigning the new integer to frames.
Explain
Why are 96 and "96" different even if they look similar when printed?
Compare your answer · self-reviewed
96 is an integer; "96" is text. Later arithmetic needs the numeric value, not a string that happens to contain digits.
Repair
A task asks for frame_count, but you create Frame_count. Why can the checker not find the requested value?
Compare your answer · self-reviewed
Names are case-sensitive. Use the declared lowercase name; the prompt and checks must agree about the interface.
Choose an exercise to load its prompt.
Today's idea in two other voices, if you want one. Not required — the exercises above are the actual lesson.
- Variables in Python: Usage and Best Practices — article, Real Python
- Python Tutorial for Beginners 2: Strings — video, Corey Schafer
Loading exercises…
Noted on your route map, with the step you were on. Nothing is lost by parking it — the next review day will bring this idea back, and the flag tells the course where to slow down.
The tutor mounts here when JavaScript is available. The lesson above stays readable without it.