7.5 - String Formatting
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
Write a string using an f-string that includes a name and age.
💡 Hint: Remember to define the variables before using them in the f-string.
Format a string using .format() to say 'Welcome to {place}' with the variable place.
💡 Hint: Define place with any location you want to use.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does an f-string allow you to do in Python?
💡 Hint: Think about the syntax of f-strings.
True or False: The .format() method requires you to use curly braces for placeholders.
💡 Hint: Consider how placeholders are represented in the method.
1 more question available
Challenge Problems
Push your limits with advanced challenges
Write a section of code using f-strings to generate a report of a student’s name, math score, and overall grade.
💡 Hint: Think about how each variable contributes to the sentence.
Create a formatted string using .format() to describe a person's pet, their name, breed, and age.
💡 Hint: Make sure each variable is accurately defined before printing.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.