03.08 · Python basics / Practice · 6 min
Make the placeholders display values
The message has the right placeholders, but Python is printing them literally. Enable the missing formatting.
Activity 8 of 19 in Python basics
Python Basics / 03.08
Practice formatted strings
Not started
Fix a sentence that prints variable names inside braces instead of the learner’s details.
Your lesson progress
Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Build it one step at a time
Prefer learning by typing? Work through short instructions, run the Python code and check each change before continuing. Your guided project saves separately from the challenge below.
The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.
Start mini-lesson(opens in a new tab)4 steps · Saved work · Instant feedback
YOUR TURN
Turn the placeholders into learner details
Keep learner_name assigned to "Ada" and learner_city assigned to "Miami". Make introduction an f-string that reads both variable values inside braces. Keep the print call. To pass: both variables must keep their values, introduction must hold "Ada lives in Miami.", and that sentence must print exactly once. After passing, try another city and rebuild the introduction to see it change.
Ada lives in Miami.
Keep the starting inputs. Print these lines in this order, without extra output.
- learner_name still holds Ada
- learner_city still holds Miami
- introduction holds Ada lives in Miami.
Edit Python, then run it. Check challenge checks your output and the listed Python requirements. Your code saves on this browser after a short pause. Sign in and choose Save account draft to keep it across devices. Word wrap is enabled.
Ready to checkRun the checks to see your results here.
Your check results
Need a nudge?
Look before the opening quote
Braces inside an ordinary string are just characters. Compare the string prefix with the f-string example in the lesson.
Read the names inside the braces
Use learner_name and learner_city without quotes inside the braces. Keep the space on each side of lives in and the final period.
One possible solution
Your code may look different and still be correct. Compare the approach with your own.
The f prefix tells Python to evaluate the expressions in braces while creating this string. Each expression reads its named value. Without f, Python keeps the braces and names as literal text. The checks confirm output and stored values; explain the formatting yourself rather than treating passing checks as proof of your chosen technique.
learner_name = "Ada"
learner_city = "Miami"
introduction = f"{learner_name} lives in {learner_city}."
print(introduction)Ready to try it?
Practice in your browser and see your results.
Progress details
Have a question?
Ask the Code Zone community.
Ask a question in The Code Zone (opens in a new tab)Continue learning

7 days freeTry The Code Zone
THE CODE ZONE COMMUNITY
Your next step is easier together.
Try the community free for 7 days.
No charge during your trial. Choose your plan on Skool.
- Ask questions and get support in the community
- Watch every course video walkthrough
- Find a study buddy in the 24/7 study room
Make the most of your trial with Premium.
Choose Premium on Skool to try Thursday live help sessions. Bring your questions, work through code, and get unstuck together.
Scheduled Thursdays in Eastern Time. Check the Skool calendar for your local date and time.
Have a website account? Sign in