Sixteen lessons ago, you had never written a line of code. Now you can do all of this — and you should pause and notice that, because it is a lot:
if
chains, for loops, and while loops.Run this recap program. Every line uses something from this course, and nothing else:
name = "Coder"
score = 0
for round in range(3):
score = score + 10
print(name + " has " + str(score) + " points.")
if score >= 30:
print("Finished!")
Output:
Coder has 10 points.
Coder has 20 points.
Coder has 30 points.
Finished!
If you can read that program line by line and say what each part does, you have genuinely learned the foundations — not memorized them, but understood them well enough to read real code.
This course was designed as the on-ramp to Dante's Python 3 Programming course, and the step is deliberately smooth. You already know its opening ground: setup, IDLE, printing, variables, numbers, strings, comparisons, decisions, and loops. Its opening lessons will therefore move faster for you than for someone starting cold — you will recognize the ideas and spend your energy on the new material instead of the setup.
The new material waiting there includes:
None of that requires anything you do not already have. The guessing
game's while loop, the Turtle program's loop-drawn square, and the
dictionary's labeled entries are the same thinking those bigger
topics are built from — just applied to larger problems.
Three habits will carry you further than any single course:
If you ever feel stuck, go back one lesson, not back to the start. The foundations stack: a wobble in one layer is fixed by revisiting that layer, not by rebuilding the whole tower.
Answer key: 1. Any three from the recap list, for example: save and run program files, use loops, build a complete game. 2. Because you already know its opening ground — setup, IDLE, variables, strings, decisions, and loops — so your energy goes to the new material. 3. Files (programs remembering things between runs); object-oriented programming (bundling data and code into objects); networking (programs talking to other computers). 4. Because a working starting point shows what "correct" looks like, and each small change teaches one thing. 5. Revisit the one layer you wobbled on — do not rebuild from the start.
Course complete — see you in Python 3 Programming.
Work through the slides with Helio's narration, or download them:
Open the slidesDownload PowerPointDownload PDF
Run the lesson's example with real Python, right in your browser (Python loads from the internet, so you need to be online).
Download lesson17-practice.pyDownload the solution
# Lesson 17: What's Next — Stepping into Python 3
# WHAT TO DO: This recap program uses only ideas from this course:
# variables, a for loop, an if, and a dictionary. The dictionary at
# line 20 holds the player's name and final score, but the last line
# is unfinished. Fill in line 21: replace the placeholder with a final
# message built from the dictionary, for example:
# print(player["name"] + " finished with " + str(player["score"]) + " points.")
# HINT: str() turns the score number into text so it can join the
# message with +. Only change the placeholder line.
# Run with F5 in IDLE. You are done when the last line is a real
# final message, not a placeholder.
name = "Coder"
score = 0
for round in range(3):
score = score + 10
print(name + " has " + str(score) + " points.")
if score >= 30:
print("Finished!")
player = {"name": name, "score": score}
print("TODO - a final message from the dictionary") # <-- CHANGE THIS LINE
Save the file as lesson17-practice.py and run it with F5 in IDLE. On a Mac, if F5 does nothing, use Run, then Run Module, from the menu.
Five quick questions on this lesson. Take the Lesson 17 quiz
Enroll free in the full course — same 17 lessons, with your progress saved. Free, no payment.