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 an f-string that incorporates a variable for the user's name.
Use the format: 'Hello, {variable_name}!'
Create an f-string that shows a score of 100.
Format it as: 'You scored {variable_name} points!'
What does f-string stand for?
Remember what the 'f' at the start signifies.
True or False: f-strings can include expressions inside curly braces.
Think about if you can perform calculations inside an f-string.
Write a function that takes a name and score and returns a formatted string using f-strings.
Build the function to take parameters and produce output using f-strings.
How would you display a formatted string for age and height (in cm) using an f-string?
Remember to declare your variables before using them in your f-string.
5 more questions in this section. Enroll free to practise them all.
Enroll free