Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Write a string using an f-string that includes a name and age.
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.
Define place with any location you want to use.
What does an f-string allow you to do in Python?
Think about the syntax of f-strings.
True or False: The .format() method requires you to use curly braces for placeholders.
Consider how placeholders are represented in the method.
Write a section of code using f-strings to generate a report of a student’s name, math score, and overall grade.
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.
Make sure each variable is accurately defined before printing.
5 more questions in this section. Enroll free to practise them all.
Enroll free