Your first lab with a partner. Everything from Week 2 — inputs, strings, methods, f-strings — in one program that’s actually fun to run on your friends.
No reading — pair up and build. Keep 2.7 (f-strings) and 2.4 (input) open. Decide who drives first.
End of Week 2 in Programs. You put the whole week together and practice the collaboration process from 2.9 — the exact muscles the Create PT grades.
Build a Mad Libs generator in Python: collect silly words from the user, then drop them into a story and print it. With a partner, using the driver/navigator method.
□ A purpose sentence comment at the top.
□ At least four inputs (e.g. a noun, a verb, an adjective, a name).
□ Store each in a well-named variable.
□ Assemble the story with an f-string (2.7), not a pile of +.
□ Use at least one string method — e.g. .upper() a word for emphasis, or .capitalize() a name.
□ Print the finished story cleanly.
Copy the shape, not the story — then write your own, funnier one:
# This program builds a silly story from user # words so that two friends can make each other laugh. name = input("A name? ") adj = input("An adjective? ") animal = input("An animal? ") verb = input("A verb? ") story = f"{name} met a {adj} {animal} that could {verb}!" print(story.upper())
# purpose: what + why # # four inputs, each stored # in a clearly named # variable # # f-string drops them into the story # a string method for flair
Hover or tap a line to light its twin. Your job: keep this structure, invent a better story, and add a fifth input for the Challenge tier.
Fill the blanks and generate the story the skeleton above would print. This is exactly what your program should do — use it to check your output looks right.
□ The working program (runs, four+ inputs, f-string output).
□ Your purpose sentence at the top of the file.
□ One sentence about a bug you fixed — and name its type (syntax, run-time, or logic, from 2.8). Every pair hits at least one; that’s the point.
That bug sentence is small but it’s real Create PT practice: describing your development process in precise words is worth points in May.
Driver has the keyboard and types. Navigator reads along, catches typos and logic slips, and thinks about the next step. Neither role is “the helper” — the navigator is doing half the programming, out loud.
When the timer hits ten minutes, swap, even mid-line. Both of you must be able to explain every line by the end — if the navigator goes quiet, the method isn’t working. Talk the whole time.
Add a fifth and sixth input and a second paragraph so
the story has a beginning and an end. Or: use a string method to auto-.capitalize()
the name no matter how it’s typed, and .lower() the animal so
“LLAMA” and “llama” both read cleanly. Small polish, real craft.
if.